FIRCLSManagerData.m 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/Controllers/FIRCLSContextManager.h"
  17. #import "Crashlytics/Crashlytics/Models/FIRCLSExecutionIdentifierModel.h"
  18. #import "Crashlytics/Crashlytics/Models/FIRCLSInstallIdentifierModel.h"
  19. #import "Crashlytics/Crashlytics/Models/FIRCLSSettings.h"
  20. #import "Crashlytics/Crashlytics/Private/FIRCLSOnDemandModel_Private.h"
  21. #import "Crashlytics/Crashlytics/Settings/Models/FIRCLSApplicationIdentifierModel.h"
  22. @implementation FIRCLSManagerData
  23. - (instancetype)initWithGoogleAppID:(NSString *)googleAppID
  24. googleTransport:(GDTCORTransport *)googleTransport
  25. installations:(FIRInstallations *)installations
  26. analytics:(nullable id<FIRAnalyticsInterop>)analytics
  27. fileManager:(FIRCLSFileManager *)fileManager
  28. dataArbiter:(FIRCLSDataCollectionArbiter *)dataArbiter
  29. settings:(FIRCLSSettings *)settings
  30. onDemandModel:(FIRCLSOnDemandModel *)onDemandModel {
  31. self = [super init];
  32. if (!self) {
  33. return nil;
  34. }
  35. _googleAppID = googleAppID;
  36. _googleTransport = googleTransport;
  37. _installations = installations;
  38. _analytics = analytics;
  39. _fileManager = fileManager;
  40. _dataArbiter = dataArbiter;
  41. _settings = settings;
  42. _onDemandModel = onDemandModel;
  43. _contextManager = [[FIRCLSContextManager alloc] init];
  44. _appIDModel = [[FIRCLSApplicationIdentifierModel alloc] init];
  45. _installIDModel = [[FIRCLSInstallIdentifierModel alloc] initWithInstallations:installations];
  46. _executionIDModel = [[FIRCLSExecutionIdentifierModel alloc] init];
  47. NSString *sdkBundleID = FIRCLSApplicationGetSDKBundleID();
  48. _operationQueue = [NSOperationQueue new];
  49. [_operationQueue setMaxConcurrentOperationCount:1];
  50. [_operationQueue setName:[sdkBundleID stringByAppendingString:@".work-queue"]];
  51. _dispatchQueue = dispatch_queue_create("com.google.firebase.crashlytics.startup", 0);
  52. _operationQueue.underlyingQueue = _dispatchQueue;
  53. return self;
  54. }
  55. @end