-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pass invalidation handler to ExtensionProcess::grantCapability #28731
Pass invalidation handler to ExtensionProcess::grantCapability #28731
Conversation
EWS run on previous version of this PR (hash 9a66f23) |
9a66f23
to
2b99bd1
Compare
EWS run on previous version of this PR (hash 2b99bd1) |
@@ -388,14 +388,6 @@ static ASCIILiteral runningBoardDomainForAssertionType(ProcessAssertionType asse | |||
if (process.extensionProcess()) { | |||
ASCIILiteral runningBoardAssertionName = runningBoardNameForAssertionType(m_assertionType); | |||
ASCIILiteral runningBoardDomain = runningBoardDomainForAssertionType(m_assertionType); | |||
auto didInvalidateBlock = [weakThis = ThreadSafeWeakPtr { *this }, runningBoardAssertionName] () { |
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.
Why this change?
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.
Presumably so the code can be shared with the call on L477
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.
Yes, that is correct.
Thanks for reviewing, all!
@@ -84,7 +88,7 @@ | |||
return grant; | |||
} | |||
|
|||
PlatformGrant ExtensionProcess::grantCapability(const PlatformCapability& capability) const | |||
PlatformGrant ExtensionProcess::grantCapability(const PlatformCapability& capability, Function<void()>&& invalidationHandler) const |
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.
Could this take an AssertionCapability
instead of a PlatformCapability
as an argument and just use the m_didInvalidateBlock
from AssertionCapability
? It seems a bit weird to be passing the invalidation block in two different places...
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.
That's a good point! I will make that change.
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.
I started on this change, but it became more involving than expected, because this method is also used to grant Media capabilities. Would you be OK with the current approach, Ben?
2b99bd1
to
7f49181
Compare
EWS run on previous version of this PR (hash 7f49181) |
7f49181
to
1b9e666
Compare
EWS run on previous version of this PR (hash 1b9e666) |
1b9e666
to
4e1886e
Compare
EWS run on previous version of this PR (hash 4e1886e) |
4e1886e
to
c1f9e37
Compare
EWS run on previous version of this PR (hash c1f9e37) |
c1f9e37
to
7c77bf4
Compare
EWS run on previous version of this PR (hash 7c77bf4) |
7c77bf4
to
5bfe028
Compare
047e663
to
ce15a65
Compare
EWS run on previous version of this PR (hash ce15a65) |
ce15a65
to
00abc02
Compare
EWS run on previous version of this PR (hash 00abc02) |
00abc02
to
9a60324
Compare
EWS run on previous version of this PR (hash 9a60324) |
9a60324
to
ad2dbb8
Compare
EWS run on previous version of this PR (hash ad2dbb8) |
Looking closer, I think the test failures on iOS are unrelated to this patch. |
This radar is already in Integrate so I doubt this is the right link. |
Ah, good catch, the radar state was not correct. Thanks for approving, Chris! |
ad2dbb8
to
a4e26e4
Compare
EWS run on current version of this PR (hash a4e26e4) |
https://bugs.webkit.org/show_bug.cgi?id=274331 rdar://126825362 Reviewed by Chris Dumez. In order for the invalidation handler to be called when the grant is invalidated, we need to pass the invalidation handler to ExtensionProcess::grantCapability. * Source/WebKit/Platform/cocoa/AssertionCapability.h: * Source/WebKit/UIProcess/Cocoa/ProcessAssertionCocoa.mm: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::acquireSync): (WebKit::Function<void): * Source/WebKit/UIProcess/Launcher/ProcessLauncher.h: * Source/WebKit/UIProcess/Launcher/cocoa/ExtensionProcess.h: * Source/WebKit/UIProcess/Launcher/cocoa/ExtensionProcess.mm: (WebKit::ExtensionProcess::grantCapability const): * Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::LaunchGrant::LaunchGrant): (WebKit::LaunchGrant::~LaunchGrant): * Source/WebKit/UIProcess/ProcessAssertion.h: Canonical link: https://commits.webkit.org/279428@main
a4e26e4
to
1191300
Compare
Committed 279428@main (1191300): https://commits.webkit.org/279428@main Reviewed commits have been landed. Closing PR #28731 and removing active labels. |
1191300
a4e26e4
π ios-simπ§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ api-iosπ§ͺ gtk-wk2π§ͺ api-gtk