WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
233015
[Cocoa] Web Inspector: fix bundle identifier lookup for enabling remote inspection
https://bugs.webkit.org/show_bug.cgi?id=233015
Summary
[Cocoa] Web Inspector: fix bundle identifier lookup for enabling remote inspe...
Blaze Burg
Reported
2021-11-11 14:21:10 PST
.
Attachments
Patch v1.0
(1.70 KB, patch)
2021-11-11 14:24 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Patch v1.1
(5.87 KB, patch)
2021-11-11 15:12 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Patch v1.2
(5.77 KB, patch)
2021-11-15 12:39 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Patch for Landing
(5.79 KB, patch)
2021-11-30 10:44 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Blaze Burg
Comment 1
2021-11-11 14:21:39 PST
<
rdar://85277115
>
Blaze Burg
Comment 2
2021-11-11 14:24:49 PST
Created
attachment 444001
[details]
Patch v1.0
Blaze Burg
Comment 3
2021-11-11 15:12:36 PST
Created
attachment 444008
[details]
Patch v1.1
Darin Adler
Comment 4
2021-11-11 17:05:14 PST
Comment on
attachment 444008
[details]
Patch v1.1 View in context:
https://bugs.webkit.org/attachment.cgi?id=444008&action=review
> Source/WebKit/UIProcess/Inspector/WebInspectorUtilities.h:48 > +String bundleIdentifierForSandboxBroker();
I think this should return a CFStringRef. Also, could return ASCIILiteral if you really want to stick with WTF instead of platform-specific.
Patrick Angle
Comment 5
2021-11-12 11:09:29 PST
Comment on
attachment 444008
[details]
Patch v1.1 View in context:
https://bugs.webkit.org/attachment.cgi?id=444008&action=review
> Source/WebKit/UIProcess/Inspector/WebInspectorUtilities.cpp:119 > + auto sandboxBrokerBundleIdentifier = "com.apple.Safari.SandboxBroker"_s;
Nit: Now that this logic is in a standalone function, can we just return the correct string inside the conditionals instead of setting a local variable?
Blaze Burg
Comment 6
2021-11-15 12:39:09 PST
Created
attachment 444296
[details]
Patch v1.2
Darin Adler
Comment 7
2021-11-15 14:37:17 PST
Comment on
attachment 444296
[details]
Patch v1.2 View in context:
https://bugs.webkit.org/attachment.cgi?id=444296&action=review
> Source/WebKit/UIProcess/Cocoa/WebInspectorPreferenceObserver.mm:53 > + String sandboxBrokerBundleIdentifier = WebKit::bundleIdentifierForSandboxBroker();
I suggest not involving WTF::String at all: auto sandboxBrokerBundleIdentifier = WebKit::bundleIdentifierForSandboxBroker(); m_userDefaults = adoptNS([[NSUserDefaults alloc] initWithSuiteName:bridge_cast(sandboxBrokerBundleIdentifier)]); if (!m_userDefaults) { WTFLogAlways("Could not init user defaults instance for domain %@.", sandboxBrokerBundleIdentifier);
Darin Adler
Comment 8
2021-11-15 17:07:13 PST
Comment on
attachment 444296
[details]
Patch v1.2 View in context:
https://bugs.webkit.org/attachment.cgi?id=444296&action=review
> Source/WebKit/UIProcess/Inspector/WebInspectorUtilities.cpp:122 > + if (WebCore::applicationBundleIdentifier() == "com.apple.SafariTechnologyPreview"_s) > + return CFSTR("com.apple.SafariTechnologyPreview.SandboxBroker"); > + if (WebCore::applicationBundleIdentifier() == "com.apple.Safari.automation"_s) > + return CFSTR("com.apple.Safari.automation.SandboxBroker");
One other thought: Since bundle identifiers are not case sensitive, it might be safer to call equalLettersIgnoringASCIICase instead of using ==.
Blaze Burg
Comment 9
2021-11-30 10:44:01 PST
Created
attachment 445440
[details]
Patch for Landing
Joseph Pecoraro
Comment 10
2021-11-30 10:53:10 PST
Comment on
attachment 445440
[details]
Patch for Landing View in context:
https://bugs.webkit.org/attachment.cgi?id=445440&action=review
> Source/WebKit/UIProcess/Inspector/WebInspectorUtilities.cpp:119 > + if (WebCore::applicationBundleIdentifier() == "com.apple.SafariTechnologyPreview"_s)
Perhaps avoid calling `WebCore::applicationBundleIdentifier` twice with a local? Is the result always `applicationBundleIdentifier() + ".SandboxBroker"?
EWS
Comment 11
2021-11-30 12:10:40 PST
Committed
r286314
(
244673@main
): <
https://commits.webkit.org/244673@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 445440
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug