Skip to content
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

Only set launch sandbox state variable once #14881

Conversation

pvollan
Copy link
Contributor

@pvollan pvollan commented Jun 12, 2023

@pvollan pvollan requested a review from cdumez as a code owner June 12, 2023 19:41
@pvollan pvollan self-assigned this Jun 12, 2023
@pvollan pvollan added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Jun 12, 2023
@@ -484,8 +484,11 @@ Ref<WebPage> WebPage::create(PageIdentifier pageID, WebPageCreationParameters&&
WebProcess::singleton().injectedBundle()->didCreatePage(page.ptr());

#if HAVE(SANDBOX_STATE_FLAGS)
auto auditToken = WebProcess::singleton().auditTokenForSelf();
sandbox_enable_state_flag("WebContentProcessLaunched", *auditToken);
static dispatch_once_t onceToken;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a global static boolean. We don't need a dispatch_once because we don't need locking because there is only a single thread involved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point, will fix!

Thanks for reviewing!

@pvollan pvollan force-pushed the eng/Only-set-launch-sandbox-state-variable-once branch from 01c1405 to 82f0dcf Compare June 12, 2023 20:17
@pvollan pvollan requested a review from cdumez June 12, 2023 20:18
@pvollan pvollan added the merge-queue Applied to send a pull request to merge-queue label Jun 12, 2023
https://bugs.webkit.org/show_bug.cgi?id=257974
rdar://110660033

Reviewed by Chris Dumez.

Only set launch sandbox state variable once to improve performance.

* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):

Canonical link: https://commits.webkit.org/265088@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Only-set-launch-sandbox-state-variable-once branch from 82f0dcf to b4b2f80 Compare June 12, 2023 21:03
@webkit-commit-queue
Copy link
Collaborator

Committed 265088@main (b4b2f80): https://commits.webkit.org/265088@main

Reviewed commits have been landed. Closing PR #14881 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit b4b2f80 into WebKit:main Jun 12, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
4 participants