New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PLAT-10049] Added view_load_phase spans #143
Conversation
Generated by 🚫 Danger |
|
||
controller = [MyTestViewController new]; | ||
[controller loadView]; | ||
[controller viewDidLoad]; | ||
XCTAssertEqual(1U, perf->testing_getBatchCount()); | ||
XCTAssertEqual(6U, perf->testing_getBatchCount()); | ||
// Temporarily disabled to stop crashes while we build a more complete solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh could you uncomment these 2 disabled lines again? I forgot to do it after the refactor.
|
||
selector = @selector(viewWillLayoutSubviews); | ||
IMP viewWillLayoutSubviews __block = nullptr; | ||
viewWillLayoutSubviews = ObjCSwizzle::replaceInstanceMethodOverride(cls, selector, ^(id self, BOOL animated){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewWillLayoutSubviews
is type void, so it won't have BOOL animated
.
Trace(@"%@ -[%s %s]", self, class_getName(cls), sel_getName(selector)); | ||
} | ||
BugsnagPerformanceSpan *span = startViewLoadPhaseSpan(self, @"viewWillLayoutSubviews"); | ||
reinterpret_cast<void (*)(id, SEL, BOOL)>(viewWillLayoutSubviews)(self, selector, animated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be reinterpret_cast<void (*)(id, SEL)>
|
||
selector = @selector(viewDidLayoutSubviews); | ||
IMP viewDidLayoutSubviews __block = nullptr; | ||
viewDidLayoutSubviews = ObjCSwizzle::replaceInstanceMethodOverride(cls, selector, ^(id self, BOOL animated){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here:viewDidLayoutSubviews
is a void method.
|
||
selector = @selector(viewWillAppear:); | ||
IMP viewWillAppear __block = nullptr; | ||
viewWillAppear = ObjCSwizzle::replaceInstanceMethodOverride(cls, selector, ^(id self){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewWillAppear
takes a BOOL parameter, so this must be ^(id self, BOOL animated)
Trace(@"%@ -[%s %s]", self, class_getName(cls), sel_getName(selector)); | ||
} | ||
BugsnagPerformanceSpan *span = startViewLoadPhaseSpan(self, @"viewWillAppear"); | ||
reinterpret_cast<void (*)(id, SEL)>(viewWillAppear)(self, selector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be reinterpret_cast<void (*)(id, SEL, BOOL)>
# Conflicts: # features/automatic_spans.feature
No description provided.