feat:fix cannot record onDestroy

This commit is contained in:
pengfei.zhou 2021-07-08 12:46:15 +08:00 committed by osborn
parent f5bd4406d9
commit 5c4bbe2fa5
2 changed files with 5 additions and 3 deletions

View File

@ -146,7 +146,7 @@ public class DoricNativeDriver implements IDoricDriver {
if (doricContext != null) { if (doricContext != null) {
return doricContext.getPerformanceProfile(); return doricContext.getPerformanceProfile();
} }
return new DoricPerformanceProfile("Empty"); return new DoricPerformanceProfile(contextId);
} }
@Override @Override

View File

@ -170,7 +170,8 @@ - (DoricAsyncResult *)invokeContextEntity:(NSString *)contextId method:(NSString
- (DoricAsyncResult *)createContext:(NSString *)contextId script:(NSString *)script source:(NSString *)source { - (DoricAsyncResult *)createContext:(NSString *)contextId script:(NSString *)script source:(NSString *)source {
DoricAsyncResult *ret = [[DoricAsyncResult alloc] init]; DoricAsyncResult *ret = [[DoricAsyncResult alloc] init];
DoricPerformanceProfile *performanceProfile = [DoricContextManager.instance getContext:contextId].performanceProfile; DoricPerformanceProfile *performanceProfile = [DoricContextManager.instance getContext:contextId].performanceProfile
?: [[DoricPerformanceProfile alloc] initWithName:contextId];
[performanceProfile prepare:@"Create"]; [performanceProfile prepare:@"Create"];
__weak typeof(self) _self = self; __weak typeof(self) _self = self;
[self.jsExecutor ensureRunOnJSThread:^{ [self.jsExecutor ensureRunOnJSThread:^{
@ -191,7 +192,8 @@ - (DoricAsyncResult *)createContext:(NSString *)contextId script:(NSString *)scr
- (DoricAsyncResult *)destroyContext:(NSString *)contextId { - (DoricAsyncResult *)destroyContext:(NSString *)contextId {
DoricAsyncResult *ret = [[DoricAsyncResult alloc] init]; DoricAsyncResult *ret = [[DoricAsyncResult alloc] init];
DoricPerformanceProfile *performanceProfile = [DoricContextManager.instance getContext:contextId].performanceProfile; DoricPerformanceProfile *performanceProfile = [DoricContextManager.instance getContext:contextId].performanceProfile
?: [[DoricPerformanceProfile alloc] initWithName:contextId];
[performanceProfile prepare:@"Destroy"]; [performanceProfile prepare:@"Destroy"];
__weak typeof(self) _self = self; __weak typeof(self) _self = self;
[self.jsExecutor ensureRunOnJSThread:^{ [self.jsExecutor ensureRunOnJSThread:^{