Title: [280038] trunk/Source/WebKit
Revision
280038
Author
[email protected]
Date
2021-07-19 11:13:54 -0700 (Mon, 19 Jul 2021)

Log Message

[Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
https://bugs.webkit.org/show_bug.cgi?id=227971

Reviewed by Per Arne Vollan.

r271294 fixed inspecting Service Workers on macOS, but in the process broke inspecting Service Workers on iOS.
For iOS, previously a flag was set to mark RemoteInspector as needing to wait for a Sandbox Extension handle,
but after r271294 this flag will no longer be cleared properly, as the handle is acquired and consumed prior to
the point in initialization that iOS was special cased to wait for the handle. To resolve this, we now set the
flag once based on whether we were able to acquire a handle, which due to the changes in r270326 will already
have been done by the time we are initializing a WebProcess.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280037 => 280038)


--- trunk/Source/WebKit/ChangeLog	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/ChangeLog	2021-07-19 18:13:54 UTC (rev 280038)
@@ -1,3 +1,22 @@
+2021-07-19  Patrick Angle  <[email protected]>
+
+        [Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
+        https://bugs.webkit.org/show_bug.cgi?id=227971
+
+        Reviewed by Per Arne Vollan.
+
+        r271294 fixed inspecting Service Workers on macOS, but in the process broke inspecting Service Workers on iOS.
+        For iOS, previously a flag was set to mark RemoteInspector as needing to wait for a Sandbox Extension handle,
+        but after r271294 this flag will no longer be cleared properly, as the handle is acquired and consumed prior to
+        the point in initialization that iOS was special cased to wait for the handle. To resolve this, we now set the
+        flag once based on whether we were able to acquire a handle, which due to the changes in r270326 will already
+        have been done by the time we are initializing a WebProcess.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2021-07-19  Tim Horton  <[email protected]>
 
         Fix the build.

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (280037 => 280038)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-07-19 18:13:54 UTC (rev 280038)
@@ -525,9 +525,6 @@
 #endif
 
 #if ENABLE(REMOTE_INSPECTOR) && PLATFORM(COCOA)
-#if PLATFORM(IOS)
-    Inspector::RemoteInspector::setNeedMachSandboxExtension(true);
-#endif
     if (std::optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken()) {
         RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken)));
         Inspector::RemoteInspector::singleton().setParentProcessInformation(WebCore::presentingApplicationPID(), auditData);

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (280037 => 280038)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-07-19 18:13:54 UTC (rev 280038)
@@ -292,8 +292,7 @@
     SandboxExtension::consumePermanently(parameters.containerTemporaryDirectoryExtensionHandle);
 #endif
 #if PLATFORM(COCOA) && ENABLE(REMOTE_INSPECTOR)
-    if (SandboxExtension::consumePermanently(parameters.enableRemoteWebInspectorExtensionHandle))
-        Inspector::RemoteInspector::setNeedMachSandboxExtension(false);
+    Inspector::RemoteInspector::setNeedMachSandboxExtension(!SandboxExtension::consumePermanently(parameters.enableRemoteWebInspectorExtensionHandle));
 #endif
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to