refact: use DoricSingleton to hold all static or singleton objects

This commit is contained in:
pengfei.zhou
2021-07-21 17:56:03 +08:00
committed by osborn
parent 7d4d6713c6
commit 61c262bcc6
30 changed files with 320 additions and 221 deletions

View File

@@ -20,6 +20,7 @@
// Created by jingpeng.wang on 2020/2/25.
//
#import <DoricCore/Doric.h>
#import <DoricCore/DoricSingleton.h>
#import <DoricCore/DoricNativeDriver.h>
#import <DoricCore/DoricContextManager.h>
@@ -78,8 +79,8 @@ - (instancetype)init {
if (self = [super init]) {
_callbacks = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];
_reloadingContexts = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];
[DoricNativeDriver.instance.registry registerMonitor:[DoricDevMonitor new]];
DoricNativeDriver.instance.registry.globalPerformanceAnchorHook = [DoricDevPerformanceAnchorHook new];
[DoricSingleton.instance.nativeDriver.registry registerMonitor:[DoricDevMonitor new]];
DoricSingleton.instance.nativeDriver.registry.globalPerformanceAnchorHook = [DoricDevPerformanceAnchorHook new];
}
return self;
}