Skip to content

Commit 23b6a91

Browse files
authored
ref: Use scope observer protocol in dependency container (#6423)
1 parent f5d75da commit 23b6a91

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ - (SentryDebugImageProvider *)debugImageProvider SENTRY_THREAD_SANITIZER_DOUBLE_
410410
}
411411

412412
#if SENTRY_HAS_UIKIT
413-
- (SentryWatchdogTerminationScopeObserver *)getWatchdogTerminationScopeObserverWithOptions:
414-
(SentryOptions *)options
413+
- (id<SentryScopeObserver>)getWatchdogTerminationScopeObserverWithOptions:(SentryOptions *)options
415414
{
416415
// This method is only a factory, therefore do not keep a reference.
417416
// The scope observer will be created each time it is needed.

Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options
8888

8989
self.appStateManager = appStateManager;
9090

91-
SentryWatchdogTerminationScopeObserver *scopeObserver =
92-
[SentryDependencyContainer.sharedInstance
93-
getWatchdogTerminationScopeObserverWithOptions:options];
91+
id<SentryScopeObserver> scopeObserver = [SentryDependencyContainer.sharedInstance
92+
getWatchdogTerminationScopeObserverWithOptions:options];
9493

9594
[SentrySDKInternal.currentHub configureScope:^(SentryScope *_Nonnull outerScope) {
9695
// Add the observer to the scope so that it can be notified when the scope changes.

Sources/Sentry/include/HybridPublic/SentryDependencyContainer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
@class SentryScreenshotSource;
4848
@class SentryViewHierarchyProvider;
4949
@class SentryUIViewControllerPerformanceTracker;
50-
@class SentryWatchdogTerminationScopeObserver;
5150
@class SentryWatchdogTerminationAttributesProcessor;
51+
@protocol SentryScopeObserver;
5252
#endif // SENTRY_UIKIT_AVAILABLE
5353

5454
#if SENTRY_HAS_UIKIT
@@ -142,8 +142,7 @@ SENTRY_NO_INIT
142142
@property (nonatomic, strong) id<SentryObjCRuntimeWrapper> objcRuntimeWrapper;
143143

144144
#if SENTRY_HAS_UIKIT
145-
- (SentryWatchdogTerminationScopeObserver *)getWatchdogTerminationScopeObserverWithOptions:
146-
(SentryOptions *)options;
145+
- (id<SentryScopeObserver>)getWatchdogTerminationScopeObserverWithOptions:(SentryOptions *)options;
147146
@property (nonatomic, strong)
148147
SentryWatchdogTerminationAttributesProcessor *watchdogTerminationAttributesProcessor;
149148
#endif

Sources/Sentry/include/SentryScope+Private.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#import <Foundation/Foundation.h>
22

33
#import "SentryScope.h"
4-
#import "SentryScopeObserver.h"
54

65
@class SentryAttachment;
76
@class SentryPropagationContext;
87
@class SentrySession;
98

9+
@protocol SentryScopeObserver;
10+
1011
NS_ASSUME_NONNULL_BEGIN
1112

1213
@interface SentryScope ()

0 commit comments

Comments
 (0)