API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2017 19:03:59 +0000 (19:03 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2017 19:03:59 +0000 (19:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175030

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next
  spin of the runloop.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
(-[TaskSchemeHandler webView:startURLSchemeTask:]): Stop calling an invalid NSError constructor.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm

index c95c7bf..8677e30 100644 (file)
@@ -1,5 +1,16 @@
 2017-08-01  Brady Eidson  <beidson@apple.com>
 
+        API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
+        https://bugs.webkit.org/show_bug.cgi?id=175030
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
+        (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next
+          spin of the runloop.
+
+2017-08-01  Brady Eidson  <beidson@apple.com>
+
         Part 2 of: Rename DatabaseProcess to StorageProcess.
         https://bugs.webkit.org/show_bug.cgi?id=174880
 
index 1439c3e..537347a 100644 (file)
@@ -32,6 +32,7 @@
 #import "WKURLSchemeTaskInternal.h"
 #import "WKWebViewInternal.h"
 #import "WebURLSchemeTask.h"
+#import <wtf/RunLoop.h>
 
 using namespace WebCore;
 
@@ -79,7 +80,9 @@ void WebURLSchemeHandlerCocoa::platformStopTask(WebPageProxy& page, WebURLScheme
 void WebURLSchemeHandlerCocoa::platformTaskCompleted(WebURLSchemeTask& task)
 {
 #if WK_API_ENABLED
-    m_apiTasks.remove(task.identifier());
+    // Release the last reference to this API task on the next spin of the runloop.
+    RunLoop::main().dispatch([takenTask = m_apiTasks.take(task.identifier())] {
+    });
 #else
     UNUSED_PARAM(task);
 #endif
index f76b0c8..476f112 100644 (file)
@@ -1,5 +1,15 @@
 2017-08-01  Brady Eidson  <beidson@apple.com>
 
+        API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
+        https://bugs.webkit.org/show_bug.cgi?id=175030
+
+        Reviewed by Andy Estes.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
+        (-[TaskSchemeHandler webView:startURLSchemeTask:]): Stop calling an invalid NSError constructor.
+
+2017-08-01  Brady Eidson  <beidson@apple.com>
+
         Part 2 of: Rename DatabaseProcess to StorageProcess.
         https://bugs.webkit.org/show_bug.cgi?id=174880
 
index d3c472e..756230c 100644 (file)
@@ -312,7 +312,7 @@ enum class Command {
                 [task didFinish];
                 break;
             case Command::Error:
-                [task didFailWithError:[[[NSError alloc] init] autorelease]];
+                [task didFailWithError:[NSError errorWithDomain:@"WebKit" code:1 userInfo:nil]];
                 break;
             }
         }