File tree Expand file tree Collapse file tree 10 files changed +45
-22
lines changed Expand file tree Collapse file tree 10 files changed +45
-22
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ @interface SentryANRTrackingIntegration () <SentryANRTrackerDelegate>
3131@property  (nonatomic , strong ) SentryDispatchQueueWrapper *dispatchQueueWrapper;
3232@property  (nonatomic , strong ) SentryCrashWrapper *crashWrapper;
3333@property  (nonatomic , strong ) SentryDebugImageProvider *debugImageProvider;
34- @property  (nonatomic , strong ) id < SentryThreadInspector>  threadInspector;
34+ @property  (nonatomic , strong ) SentryThreadInspector * threadInspector;
3535@property  (atomic , assign ) BOOL  reportAppHangs;
3636@property  (atomic , assign ) BOOL  enableReportNonFullyBlockingAppHangs;
3737
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ - (id)initWithStacktraceBuilder:(SentryStacktraceBuilder *)stacktraceBuilder
6666    return  self;
6767}
6868
69- - (instancetype )initWithOptions : (SentryOptions *)options 
69+ - (instancetype )initWithOptions : (SentryOptions *_Nullable )options 
7070{
7171    SentryInAppLogic *inAppLogic =
7272        [[SentryInAppLogic alloc ] initWithInAppIncludes: options.inAppIncludes
Original file line number Diff line number Diff line change 6363@interface  SentryFileManager  () <SentryFileManagerProtocol>
6464@end 
6565
66- @interface  SentryDefaultThreadInspector  () <SentryThreadInspector>
67- @end 
68- 
6966@interface  SentryDefaultAppStateManager  () <SentryAppStateManager>
7067@end 
7168
@@ -153,7 +150,7 @@ - (instancetype)init
153150
154151        _notificationCenterWrapper = NSNotificationCenter .defaultCenter ;
155152
156-         _processInfoWrapper = NSProcessInfo . processInfo ;
153+         _processInfoWrapper = SentryDependencies. processInfoWrapper ;
157154        _crashWrapper = [[SentryCrashWrapper alloc ] initWithProcessInfoWrapper: _processInfoWrapper];
158155#if  SENTRY_HAS_UIKIT
159156        _uiDeviceWrapper = SentryDependencies.uiDeviceWrapper ;
@@ -227,10 +224,9 @@ - (nullable SentryFileManager *)fileManager SENTRY_THREAD_SANITIZER_DOUBLE_CHECK
227224                                    notificationCenterWrapper: self .notificationCenterWrapper]);
228225}
229226
230- - (id < SentryThreadInspector> )threadInspector  SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK
227+ - (SentryThreadInspector * )threadInspector  SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK
231228{
232-     SENTRY_LAZY_INIT (_threadInspector,
233-         [[SentryDefaultThreadInspector alloc ] initWithOptions: SentrySDKInternal.options]);
229+     return  SentryDependencies.threadInspector ;
234230}
235231
236232- (SentryFileIOTracker *)fileIOTracker  SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ @interface SentryFileIOTracker ()
2222
2323@property  (nonatomic , assign ) BOOL  isEnabled;
2424@property  (nonatomic , strong ) NSMutableSet <NSData *> *processingData;
25- @property  (nonatomic , strong ) id < SentryThreadInspector>  threadInspector;
25+ @property  (nonatomic , strong ) SentryThreadInspector * threadInspector;
2626@property  (nonatomic , strong ) id <SentryProcessInfoSource> processInfoWrapper;
2727
2828@end 
@@ -42,7 +42,7 @@ + (instancetype _Nullable)sharedInstance
4242    return  SentryDependencyContainer.sharedInstance .fileIOTracker ;
4343}
4444
45- - (instancetype )initWithThreadInspector : (id < SentryThreadInspector> )threadInspector 
45+ - (instancetype )initWithThreadInspector : (SentryThreadInspector * )threadInspector 
4646                     processInfoWrapper : (id <SentryProcessInfoSource>)processInfoWrapper 
4747{
4848    if  (self = [super  init ]) {
@@ -245,7 +245,7 @@ - (void)mainThreadExtraInfo:(id<SentrySpan>)span
245245        return ;
246246    }
247247
248-     id < SentryThreadInspector>  threadInspector = self.threadInspector ;
248+     SentryThreadInspector * threadInspector = self.threadInspector ;
249249    SentryStacktrace *stackTrace = [threadInspector stacktraceForCurrentThreadAsyncUnsafe ];
250250
251251    NSArray  *frames = [stackTrace.frames
Original file line number Diff line number Diff line change 2323@class  SentryOptions;
2424@class  SentrySessionTracker;
2525@class  SentryGlobalEventProcessor;
26+ @class  SentryThreadInspector;
2627@class  SentryReachability;
2728
2829@protocol  SentryAppStateManager;
3334@protocol  SentryApplication;
3435@protocol  SentryProcessInfoSource;
3536@protocol  SentryNSNotificationCenterWrapper;
36- @protocol  SentryThreadInspector;
3737@protocol  SentryObjCRuntimeWrapper;
3838
3939#if  SENTRY_HAS_METRIC_KIT
@@ -99,7 +99,7 @@ SENTRY_NO_INIT
9999
100100@property  (nonatomic , strong , nullable ) SentryFileManager *fileManager;
101101@property  (nonatomic , strong ) id <SentryAppStateManager> appStateManager;
102- @property  (nonatomic , strong ) id < SentryThreadInspector>  threadInspector;
102+ @property  (nonatomic , strong ) SentryThreadInspector * threadInspector;
103103@property  (nonatomic , strong ) SentryFileIOTracker *fileIOTracker;
104104@property  (nonatomic , strong ) SentryCrash *crashReporter;
105105@property  (nonatomic , strong ) SentryScopePersistentStore *scopePersistentStore;
Original file line number Diff line number Diff line change 1- #import  " SentryCrashMachineContextWrapper .h" 
1+ #import  " SentryCrashThread .h" 
22#import  " SentryDefines.h" 
33#import  < Foundation/Foundation.h> 
44
77@class  SentryStacktraceBuilder;
88@class  SentryThread;
99
10+ @protocol  SentryCrashMachineContextWrapper;
11+ 
1012NS_ASSUME_NONNULL_BEGIN
1113
1214@interface  SentryDefaultThreadInspector  : NSObject 
@@ -16,7 +18,7 @@ SENTRY_NO_INIT
1618       andMachineContextWrapper : (id <SentryCrashMachineContextWrapper>)machineContextWrapper 
1719                    symbolicate : (BOOL )symbolicate ;
1820
19- - (instancetype )initWithOptions : (SentryOptions *)options ;
21+ - (instancetype )initWithOptions : (SentryOptions *_Nullable )options ;
2022
2123- (nullable SentryStacktrace *)stacktraceForCurrentThreadAsyncUnsafe ;
2224
Original file line number Diff line number Diff line change 33NS_ASSUME_NONNULL_BEGIN
44
55@protocol  SentryProcessInfoSource;
6- @protocol   SentryThreadInspector;
6+ @class   SentryThreadInspector;
77
88@interface  SentryFileIOTracker  : NSObject 
99SENTRY_NO_INIT
@@ -18,7 +18,7 @@ SENTRY_NO_INIT
1818 */  
1919+ (instancetype  _Nullable)sharedInstance ;
2020
21- - (instancetype )initWithThreadInspector : (id < SentryThreadInspector> )threadInspector 
21+ - (instancetype )initWithThreadInspector : (SentryThreadInspector * )threadInspector 
2222                     processInfoWrapper : (id <SentryProcessInfoSource>)processInfoWrapper ;
2323
2424- (void )enable ;
Original file line number Diff line number Diff line change 2929#import  " SentryCrashMonitor_AppState.h" 
3030#import  " SentryCrashMonitor_System.h" 
3131#import  " SentryDateUtils.h" 
32+ #import  " SentryDefaultThreadInspector.h" 
3233#import  " SentryDependencyContainerSwiftHelper.h" 
3334#import  " SentryEvent+Serialize.h" 
3435#import  " SentryFileIOTracker.h" 
Original file line number Diff line number Diff line change 1+ @_implementationOnly   import  _SentryPrivate
2+ 
13@objc ( SentryDependencies)   @_spi ( Private)   public  final  class  Dependencies :  NSObject  { 
4+     @objc   public  static  let  processInfoWrapper :  SentryProcessInfoSource  =  ProcessInfo . processInfo
25    @objc   public  static  let  dispatchQueueWrapper =  SentryDispatchQueueWrapper ( ) 
36    @objc   public  static  let  dateProvider =  SentryDefaultCurrentDateProvider ( ) 
47    public  static  let  objcRuntimeWrapper =  SentryDefaultObjCRuntimeWrapper ( ) 
58#if !os(watchOS) && !os(macOS) && !SENTRY_NO_UIKIT 
69    @objc   public  static  let  uiDeviceWrapper =  SentryDefaultUIDeviceWrapper ( queueWrapper:  Dependencies . dispatchQueueWrapper) 
710#endif // !os(watchOS) && !os(macOS) && !SENTRY_NO_UIKIT 
11+ 
12+     @objc   public  static  var  threadInspector :  SentryThreadInspector  =  { 
13+         SentryThreadInspector ( ) 
14+     } ( ) 
15+ 
816} 
Original file line number Diff line number Diff line change 1- @_spi ( Private)   @objc   public  protocol  SentryThreadInspector  { 
2-     func  stacktraceForCurrentThreadAsyncUnsafe( )  ->  SentryStacktrace ? 
3-     func  getCurrentThreadsWithStackTrace( )  ->  [ SentryThread ] 
4-     func  getThreadName( _ thread:  UInt )  ->  String ? 
1+ @_implementationOnly   import  _SentryPrivate
2+ 
3+ @_spi ( Private)   @objc   public  class  SentryThreadInspector :  NSObject  { 
4+     private  let  internalHelper :  SentryDefaultThreadInspector 
5+     
6+     override init ( )  { 
7+         internalHelper =  SentryDefaultThreadInspector ( options:  SentrySDKInternal . options) 
8+     } 
9+ 
10+     @objc   public  func  stacktraceForCurrentThreadAsyncUnsafe( )  ->  SentryStacktrace ? { 
11+         internalHelper. stacktraceForCurrentThreadAsyncUnsafe ( ) 
12+     } 
13+     
14+     @objc   public  func  getCurrentThreadsWithStackTrace( )  ->  [ SentryThread ]  { 
15+         internalHelper. getCurrentThreadsWithStackTrace ( ) 
16+     } 
17+     
18+     @objc   public  func  getThreadName( _ thread:  UInt )  ->  String ? { 
19+         internalHelper. getThreadName ( thread) 
20+     } 
521} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments