FIRCLSManagerData.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import "Crashlytics/Crashlytics/Controllers/FIRCLSManagerData.h"
  15. #import "Crashlytics/Crashlytics/Components/FIRCLSApplication.h"
  16. #import "Crashlytics/Crashlytics/Models/FIRCLSExecutionIdentifierModel.h"
  17. #import "Crashlytics/Crashlytics/Models/FIRCLSInstallIdentifierModel.h"
  18. #import "Crashlytics/Crashlytics/Settings/Models/FIRCLSApplicationIdentifierModel.h"
  19. @implementation FIRCLSManagerData
  20. - (instancetype)initWithGoogleAppID:(NSString *)googleAppID
  21. googleTransport:(GDTCORTransport *)googleTransport
  22. installations:(FIRInstallations *)installations
  23. analytics:(nullable id<FIRAnalyticsInterop>)analytics
  24. fileManager:(FIRCLSFileManager *)fileManager
  25. dataArbiter:(FIRCLSDataCollectionArbiter *)dataArbiter
  26. settings:(FIRCLSSettings *)settings {
  27. self = [super init];
  28. if (!self) {
  29. return nil;
  30. }
  31. _googleAppID = googleAppID;
  32. _googleTransport = googleTransport;
  33. _installations = installations;
  34. _analytics = analytics;
  35. _fileManager = fileManager;
  36. _dataArbiter = dataArbiter;
  37. _settings = settings;
  38. _appIDModel = [[FIRCLSApplicationIdentifierModel alloc] init];
  39. _installIDModel = [[FIRCLSInstallIdentifierModel alloc] initWithInstallations:installations];
  40. _executionIDModel = [[FIRCLSExecutionIdentifierModel alloc] init];
  41. NSString *sdkBundleID = FIRCLSApplicationGetSDKBundleID();
  42. _operationQueue = [NSOperationQueue new];
  43. [_operationQueue setMaxConcurrentOperationCount:1];
  44. [_operationQueue setName:[sdkBundleID stringByAppendingString:@".work-queue"]];
  45. _dispatchQueue = dispatch_queue_create("com.google.firebase.crashlytics.startup", 0);
  46. _operationQueue.underlyingQueue = _dispatchQueue;
  47. return self;
  48. }
  49. @end