Title: [276929] branches/safari-611.2.7.1-branch/Source/WebKit
Revision
276929
Author
[email protected]
Date
2021-05-03 15:02:46 -0700 (Mon, 03 May 2021)

Log Message

Cherry-pick r276514. rdar://problem/77473523

    Web Inspector: [Cocoa] WKInspectorResourceURLSchemeHandler needs to serialize cleanup actions
    https://bugs.webkit.org/show_bug.cgi?id=224986
    <rdar://76768454>

    Reviewed by Devin Rousso.

    * UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm:
    (-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]):
    Do cleanup on the main queue so that it can be serialized with reads.

    (-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]):
    Ensure that all removals from the map are processed before doing a lookup.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276514 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611.2.7.1-branch/Source/WebKit/ChangeLog (276928 => 276929)


--- branches/safari-611.2.7.1-branch/Source/WebKit/ChangeLog	2021-05-03 21:59:34 UTC (rev 276928)
+++ branches/safari-611.2.7.1-branch/Source/WebKit/ChangeLog	2021-05-03 22:02:46 UTC (rev 276929)
@@ -1,3 +1,38 @@
+2021-05-03  Russell Epstein  <[email protected]>
+
+        Cherry-pick r276514. rdar://problem/77473523
+
+    Web Inspector: [Cocoa] WKInspectorResourceURLSchemeHandler needs to serialize cleanup actions
+    https://bugs.webkit.org/show_bug.cgi?id=224986
+    <rdar://76768454>
+    
+    Reviewed by Devin Rousso.
+    
+    * UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm:
+    (-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]):
+    Do cleanup on the main queue so that it can be serialized with reads.
+    
+    (-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]):
+    Ensure that all removals from the map are processed before doing a lookup.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-23  BJ Burg  <[email protected]>
+
+            Web Inspector: [Cocoa] WKInspectorResourceURLSchemeHandler needs to serialize cleanup actions
+            https://bugs.webkit.org/show_bug.cgi?id=224986
+            <rdar://76768454>
+
+            Reviewed by Devin Rousso.
+
+            * UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm:
+            (-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]):
+            Do cleanup on the main queue so that it can be serialized with reads.
+
+            (-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]):
+            Ensure that all removals from the map are processed before doing a lookup.
+
 2021-04-29  Russell Epstein  <[email protected]>
 
         Cherry-pick r276618. rdar://problem/77326484

Modified: branches/safari-611.2.7.1-branch/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm (276928 => 276929)


--- branches/safari-611.2.7.1-branch/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm	2021-05-03 21:59:34 UTC (rev 276928)
+++ branches/safari-611.2.7.1-branch/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm	2021-05-03 22:02:46 UTC (rev 276929)
@@ -65,7 +65,9 @@
     }
 
     NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
-        [_fileLoadOperations removeObjectForKey:urlSchemeTask];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [_fileLoadOperations removeObjectForKey:urlSchemeTask];
+        });
 
         NSURL *requestURL = urlSchemeTask.request.URL;
         NSURL *fileURLForRequest = [_cachedBundle URLForResource:requestURL.relativePath withExtension:@""];
@@ -106,10 +108,13 @@
 
 - (void)webView:(WKWebView *)webView stopURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
 {
-    if (NSOperation *operation = [_fileLoadOperations objectForKey:urlSchemeTask]) {
-        [operation cancel];
-        [_fileLoadOperations removeObjectForKey:urlSchemeTask];
-    }
+    // Ensure that all blocks with pending removals are dispatched before doing a map lookup.
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (NSOperation *operation = [_fileLoadOperations objectForKey:urlSchemeTask]) {
+            [operation cancel];
+            [_fileLoadOperations removeObjectForKey:urlSchemeTask];
+        }
+    });
 }
 
 @end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to