Title: [216037] trunk
Revision
216037
Author
[email protected]
Date
2017-05-01 15:41:26 -0700 (Mon, 01 May 2017)

Log Message

Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
<rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508

Reviewed by Andy Estes.

Source/WebKit2:

This patch:
- Renames WKURLSchemeHandlerTask to WKURLSchemeTask
- Renames the method "startTask" to "startURLSchemeTask"
- Renames the method "stopTask" to "stopURLSchemeTask"

To those effects it's basically a global replace.

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
(API::URLSchemeTask::create):
(API::URLSchemeTask::URLSchemeTask):
* UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
* UIProcess/API/Cocoa/WKURLSchemeHandler.h:
* UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
* UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
(raiseExceptionIfNecessary):
(-[WKURLSchemeTaskImpl request]):
(-[WKURLSchemeTaskImpl didReceiveResponse:]):
(-[WKURLSchemeTaskImpl didReceiveData:]):
(-[WKURLSchemeTaskImpl didFinish]):
(-[WKURLSchemeTaskImpl didFailWithError:]):
(-[WKURLSchemeTaskImpl _apiObject]):
* UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
(WebKit::wrapper):
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
(WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::stopURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
(WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
(WebKit::WebURLSchemeTask::create):
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
(WebKit::WebURLSchemeTask::didReceiveResponse):
(WebKit::WebURLSchemeTask::didReceiveData):
(WebKit::WebURLSchemeTask::didComplete):
(WebKit::WebURLSchemeTask::pageDestroyed):
(WebKit::WebURLSchemeTask::stop):
* UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
(WebKit::WebURLSchemeTask::identifier):
(WebKit::WebURLSchemeTask::request):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
(WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
(WebKit::WebLoaderStrategy::remove):
(WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
(WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
(WebKit::WebPage::urlSchemeTaskDidReceiveData):
(WebKit::WebPage::urlSchemeTaskDidComplete):
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
(WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
(WebKit::WebURLSchemeHandlerProxy::startNewTask):
(WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
(WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
(WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
(WebKit::WebURLSchemeTaskProxy::startLoading):
(WebKit::WebURLSchemeTaskProxy::stopLoading):
(WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeTaskProxy::didReceiveData):
(WebKit::WebURLSchemeTaskProxy::didComplete):
(WebKit::WebURLSchemeTaskProxy::hasLoader):
* WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
(WebKit::WebURLSchemeTaskProxy::request):
(WebKit::WebURLSchemeTaskProxy::identifier):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
(-[SchemeHandler webView:startURLSchemeTask:]):
(-[SchemeHandler webView:stopURLSchemeTask:]):
(-[SchemeHandler webView:startTask:]): Deleted.
(-[SchemeHandler webView:stopTask:]): Deleted.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (216036 => 216037)


--- trunk/Source/WebKit2/CMakeLists.txt	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/CMakeLists.txt	2017-05-01 22:41:26 UTC (rev 216037)
@@ -327,7 +327,7 @@
     UIProcess/WebProcessPool.cpp
     UIProcess/WebProcessProxy.cpp
     UIProcess/WebURLSchemeHandler.cpp
-    UIProcess/WebURLSchemeHandlerTask.cpp
+    UIProcess/WebURLSchemeTask.cpp
     UIProcess/WebVibrationProvider.cpp
     UIProcess/WebVibrationProxy.cpp
     UIProcess/WebViewportAttributes.cpp
@@ -344,7 +344,7 @@
     UIProcess/API/APIProcessPoolConfiguration.cpp
     UIProcess/API/APIOpenPanelParameters.cpp
     UIProcess/API/APISessionState.cpp
-    UIProcess/API/APIURLSchemeHandlerTask.cpp
+    UIProcess/API/APIURLSchemeTask.cpp
     UIProcess/API/APIUserContentWorld.cpp
     UIProcess/API/APIUserScript.cpp
     UIProcess/API/APIUserStyleSheet.cpp
@@ -585,7 +585,7 @@
     WebProcess/WebPage/WebPageGroupProxy.cpp
     WebProcess/WebPage/WebPageOverlay.cpp
     WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp
-    WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp
+    WebProcess/WebPage/WebURLSchemeTaskProxy.cpp
     WebProcess/WebPage/WebUndoStep.cpp
 )
 

Modified: trunk/Source/WebKit2/ChangeLog (216036 => 216037)


--- trunk/Source/WebKit2/ChangeLog	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,3 +1,95 @@
+2017-05-01  Brady Eidson  <[email protected]>
+
+        Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
+        <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
+
+        Reviewed by Andy Estes.
+
+        This patch:
+        - Renames WKURLSchemeHandlerTask to WKURLSchemeTask
+        - Renames the method "startTask" to "startURLSchemeTask"
+        - Renames the method "stopTask" to "stopURLSchemeTask"
+
+        To those effects it's basically a global replace.
+
+        * Shared/API/APIObject.h:
+        * Shared/Cocoa/APIObject.mm:
+        (API::Object::newObject):
+        * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
+        (API::URLSchemeTask::create):
+        (API::URLSchemeTask::URLSchemeTask):
+        * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
+        * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
+        * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
+        * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
+        (raiseExceptionIfNecessary):
+        (-[WKURLSchemeTaskImpl request]):
+        (-[WKURLSchemeTaskImpl didReceiveResponse:]):
+        (-[WKURLSchemeTaskImpl didReceiveData:]):
+        (-[WKURLSchemeTaskImpl didFinish]):
+        (-[WKURLSchemeTaskImpl didFailWithError:]):
+        (-[WKURLSchemeTaskImpl _apiObject]):
+        * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
+        (WebKit::wrapper):
+        * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
+        * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
+        (WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
+        (WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::startURLSchemeTask):
+        (WebKit::WebPageProxy::stopURLSchemeTask):
+        (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
+        (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebURLSchemeHandler.cpp:
+        (WebKit::WebURLSchemeHandler::startTask):
+        * UIProcess/WebURLSchemeHandler.h:
+        * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
+        (WebKit::WebURLSchemeTask::create):
+        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
+        (WebKit::WebURLSchemeTask::didReceiveResponse):
+        (WebKit::WebURLSchemeTask::didReceiveData):
+        (WebKit::WebURLSchemeTask::didComplete):
+        (WebKit::WebURLSchemeTask::pageDestroyed):
+        (WebKit::WebURLSchemeTask::stop):
+        * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
+        (WebKit::WebURLSchemeTask::identifier):
+        (WebKit::WebURLSchemeTask::request):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
+        (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
+        (WebKit::WebLoaderStrategy::remove):
+        (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
+        (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
+        * WebProcess/Network/WebLoaderStrategy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
+        (WebKit::WebPage::urlSchemeTaskDidReceiveData):
+        (WebKit::WebPage::urlSchemeTaskDidComplete):
+        (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
+        (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
+        (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
+        (WebKit::WebURLSchemeHandlerProxy::startNewTask):
+        (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
+        (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
+        * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
+        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
+        (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
+        (WebKit::WebURLSchemeTaskProxy::startLoading):
+        (WebKit::WebURLSchemeTaskProxy::stopLoading):
+        (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
+        (WebKit::WebURLSchemeTaskProxy::didReceiveData):
+        (WebKit::WebURLSchemeTaskProxy::didComplete):
+        (WebKit::WebURLSchemeTaskProxy::hasLoader):
+        * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
+        (WebKit::WebURLSchemeTaskProxy::request):
+        (WebKit::WebURLSchemeTaskProxy::identifier):
+
 2017-05-01  Chris Dumez  <[email protected]>
 
         Tweak how long we allow a process to go over its background CPU limit

Modified: trunk/Source/WebKit2/Shared/API/APIObject.h (216036 => 216037)


--- trunk/Source/WebKit2/Shared/API/APIObject.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/Shared/API/APIObject.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -147,7 +147,7 @@
         RunJavaScriptConfirmResultListener,
         RunJavaScriptPromptResultListener,
         TextChecker,
-        URLSchemeHandlerTask,
+        URLSchemeTask,
         UserContentController,
         UserContentWorld,
         UserInitiatedAction,

Modified: trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm (216036 => 216037)


--- trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm	2017-05-01 22:41:26 UTC (rev 216037)
@@ -54,7 +54,7 @@
 #import "WKPreferencesInternal.h"
 #import "WKProcessPoolInternal.h"
 #import "WKSecurityOriginInternal.h"
-#import "WKURLSchemeHandlerTaskInternal.h"
+#import "WKURLSchemeTaskInternal.h"
 #import "WKUserContentControllerInternal.h"
 #import "WKUserScriptInternal.h"
 #import "WKWebProcessPlugInBrowserContextControllerInternal.h"
@@ -238,8 +238,8 @@
         wrapper = NSAllocateObject([WKNSURLRequest class], size, nullptr);
         break;
 
-    case Type::URLSchemeHandlerTask:
-        wrapper = [WKURLSchemeHandlerTaskImpl alloc];
+    case Type::URLSchemeTask:
+        wrapper = [WKURLSchemeTaskImpl alloc];
         break;
 
     case Type::UserContentController:

Deleted: trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "APIURLSchemeHandlerTask.h"
-
-#include "WebURLSchemeHandler.h"
-#include "WebURLSchemeHandlerTask.h"
-
-namespace API {
-
-Ref<URLSchemeHandlerTask> URLSchemeHandlerTask::create(WebKit::WebURLSchemeHandlerTask& webURLSchemeHandlerTask)
-{
-    return adoptRef(*new URLSchemeHandlerTask(webURLSchemeHandlerTask));
-}
-
-URLSchemeHandlerTask::URLSchemeHandlerTask(WebKit::WebURLSchemeHandlerTask& webURLSchemeHandlerTask)
-    : m_webURLSchemeHandlerTask(webURLSchemeHandlerTask)
-{
-}
-
-}

Deleted: trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "APIObject.h"
-
-namespace WebKit {
-class WebURLSchemeHandlerTask;
-}
-
-namespace API {
-
-class URLSchemeHandlerTask final : public ObjectImpl<Object::Type::URLSchemeHandlerTask> {
-public:
-    static Ref<URLSchemeHandlerTask> create(WebKit::WebURLSchemeHandlerTask&);
-
-    WebKit::WebURLSchemeHandlerTask& task() { return m_webURLSchemeHandlerTask.get(); }
-
-private:
-    URLSchemeHandlerTask(WebKit::WebURLSchemeHandlerTask&);
-
-    Ref<WebKit::WebURLSchemeHandlerTask> m_webURLSchemeHandlerTask;
-};
-
-}

Copied: trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.cpp (from rev 216036, trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "APIURLSchemeTask.h"
+
+#include "WebURLSchemeHandler.h"
+#include "WebURLSchemeTask.h"
+
+namespace API {
+
+Ref<URLSchemeTask> URLSchemeTask::create(WebKit::WebURLSchemeTask& webURLSchemeTask)
+{
+    return adoptRef(*new URLSchemeTask(webURLSchemeTask));
+}
+
+URLSchemeTask::URLSchemeTask(WebKit::WebURLSchemeTask& webURLSchemeTask)
+    : m_webURLSchemeTask(webURLSchemeTask)
+{
+}
+
+}

Copied: trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.h (from rev 216036, trunk/Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIURLSchemeTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "APIObject.h"
+
+namespace WebKit {
+class WebURLSchemeTask;
+}
+
+namespace API {
+
+class URLSchemeTask final : public ObjectImpl<Object::Type::URLSchemeTask> {
+public:
+    static Ref<URLSchemeTask> create(WebKit::WebURLSchemeTask&);
+
+    WebKit::WebURLSchemeTask& task() { return m_webURLSchemeTask.get(); }
+
+private:
+    URLSchemeTask(WebKit::WebURLSchemeTask&);
+
+    Ref<WebKit::WebURLSchemeTask> m_webURLSchemeTask;
+};
+
+}

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandler.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandler.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandler.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -32,7 +32,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class WKWebView;
-@protocol WKURLSchemeHandlerTask;
+@protocol WKURLSchemeTask;
 
 /*! A class conforming to the WKURLSchemeHandler protocol provides methods for
  loading resources with URL schemes that WebKit doesn't know how to handle itself.
@@ -43,19 +43,19 @@
 /*! @abstract Notifies your app to start loading the data for a particular resource 
  represented by the URL scheme handler task.
  @param webView The web view invoking the method.
- @param urlSchemeHandlerTask The task that your app should start loading data for.
+ @param urlSchemeTask The task that your app should start loading data for.
  */
-- (void)webView:(WKWebView *)webView startTask:(id <WKURLSchemeHandlerTask>)urlSchemeHandlerTask;
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask;
 
 /*! @abstract Notifies your app to stop handling a URL scheme handler task.
  @param webView The web view invoking the method.
- @param urlSchemeHandlerTask The task that your app should stop handling.
+ @param urlSchemeTask The task that your app should stop handling.
  @discussion After your app is told to stop loading data for a URL scheme handler task
  it must not perform any callbacks for that task.
  An exception will be thrown if any callbacks are made on the URL scheme handler task
  after your app has been told to stop loading for it.
  */
-- (void)webView:(WKWebView *)webView stopTask:(id <WKURLSchemeHandlerTask>)urlSchemeHandlerTask;
+- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask;
 
 @end
 

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WKFoundation.h>
-
-#if WK_API_ENABLED
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
-@protocol WKURLSchemeHandlerTask <NSObject>
-
-/*! @abstract The request to load for this task.
- */
-@property (nonatomic, readonly, copy) NSURLRequest *request;
-
-/*! @abstract Set the current response object for the task.
- @param response The response to use.
- @discussion This method must be called at least once for each URL scheme handler task.
- An exception will be thrown if you try to send a new response object after the task has already been completed.
- An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
- */
-- (void)didReceiveResponse:(NSURLResponse *)response;
-
-/*! @abstract Add received data to the task.
- @param data The data to add.
- @discussion After a URL scheme handler task's final response object is received you should
- start sending it data.
- Each time this method is called the data you send will be appended to all previous data.
- An exception will be thrown if you try to send the task any data before sending it a response.
- An exception will be thrown if you try to send the task any data after the task has already been completed.
- An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
- */
-- (void)didReceiveData:(NSData *)data;
-
-/*! @abstract Mark the task as successfully completed.
- @discussion An exception will be thrown if you try to finish the task before sending it a response.
- An exception will be thrown if you try to mark a task completed after it has already been marked completed or failed.
- An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
- */
-- (void)didFinish;
-
-/*! @abstract Mark the task as failed.
- @param error A description of the error that caused the task to fail.
- @discussion  An exception will be thrown if you try to mark a task failed after it has already been marked completed or failed.
- An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
- */
-- (void)didFailWithError:(NSError *)error;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WKURLSchemeHandlerTaskInternal.h"
-
-#if WK_API_ENABLED
-
-#include "WebURLSchemeHandlerTask.h"
-#include <WebCore/ResourceError.h>
-#include <WebCore/ResourceResponse.h>
-#include <WebCore/SharedBuffer.h>
-
-using namespace WebCore;
-
-static void raiseExceptionIfNecessary(WebKit::WebURLSchemeHandlerTask::ExceptionType exceptionType)
-{
-    switch (exceptionType) {
-    case WebKit::WebURLSchemeHandlerTask::ExceptionType::None:
-        return;
-    case WebKit::WebURLSchemeHandlerTask::ExceptionType::TaskAlreadyStopped:
-        [NSException raise:NSInternalInconsistencyException format:@"This task has already been stopped"];
-        break;
-    case WebKit::WebURLSchemeHandlerTask::ExceptionType::CompleteAlreadyCalled:
-        [NSException raise:NSInternalInconsistencyException format:@"[WKURLSchemeHandlerTask taskDidCompleteWithError:] has already been called for this task"];
-        break;
-    case WebKit::WebURLSchemeHandlerTask::ExceptionType::DataAlreadySent:
-        [NSException raise:NSInternalInconsistencyException format:@"[WKURLSchemeHandlerTask taskDidReceiveData:] has already been called for this task"];
-        break;
-    case WebKit::WebURLSchemeHandlerTask::ExceptionType::NoResponseSent:
-        [NSException raise:NSInternalInconsistencyException format:@"No response has been sent for this task"];
-        break;
-    }
-}
-
-@implementation WKURLSchemeHandlerTaskImpl
-
-- (NSURLRequest *)request
-{
-    return _urlSchemeHandlerTask->task().request().nsURLRequest(DoNotUpdateHTTPBody);
-}
-
-- (void)didReceiveResponse:(NSURLResponse *)response
-{
-    auto result = _urlSchemeHandlerTask->task().didReceiveResponse(response);
-    raiseExceptionIfNecessary(result);
-}
-
-- (void)didReceiveData:(NSData *)data
-{
-    auto result = _urlSchemeHandlerTask->task().didReceiveData(WebCore::SharedBuffer::create(data));
-    raiseExceptionIfNecessary(result);
-}
-
-- (void)didFinish
-{
-    auto result = _urlSchemeHandlerTask->task().didComplete({ });
-    raiseExceptionIfNecessary(result);
-}
-
-- (void)didFailWithError:(NSError *)error
-{
-    auto result = _urlSchemeHandlerTask->task().didComplete(error);
-    raiseExceptionIfNecessary(result);
-}
-
-#pragma mark WKObject protocol implementation
-
-- (API::Object&)_apiObject
-{
-    return *_urlSchemeHandlerTask;
-}
-
-@end
-
-#endif // #if WK_API_ENABLED

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WKURLSchemeHandlerTask.h"
-
-#if WK_API_ENABLED
-
-#import "APIURLSchemeHandlerTask.h"
-#import "WKObject.h"
-
-@interface WKURLSchemeHandlerTaskImpl : NSObject <WKURLSchemeHandlerTask>
-@end
-
-namespace WebKit {
-
-inline id<WKURLSchemeHandlerTask> wrapper(API::URLSchemeHandlerTask& urlSchemeHandlerTask)
-{
-    ASSERT([urlSchemeHandlerTask.wrapper() isKindOfClass:[WKURLSchemeHandlerTaskImpl class]]);
-    return (id<WKURLSchemeHandlerTask>)urlSchemeHandlerTask.wrapper();
-}
-
-}
-
-@interface WKURLSchemeHandlerTaskImpl () <WKObject> {
-@package
-    API::ObjectStorage<API::URLSchemeHandlerTask> _urlSchemeHandlerTask;
-}
-@end
-
-#endif // WK_API_ENABLED

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.h (from rev 216036, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
+@protocol WKURLSchemeTask <NSObject>
+
+/*! @abstract The request to load for this task.
+ */
+@property (nonatomic, readonly, copy) NSURLRequest *request;
+
+/*! @abstract Set the current response object for the task.
+ @param response The response to use.
+ @discussion This method must be called at least once for each URL scheme handler task.
+ An exception will be thrown if you try to send a new response object after the task has already been completed.
+ An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
+ */
+- (void)didReceiveResponse:(NSURLResponse *)response;
+
+/*! @abstract Add received data to the task.
+ @param data The data to add.
+ @discussion After a URL scheme handler task's final response object is received you should
+ start sending it data.
+ Each time this method is called the data you send will be appended to all previous data.
+ An exception will be thrown if you try to send the task any data before sending it a response.
+ An exception will be thrown if you try to send the task any data after the task has already been completed.
+ An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
+ */
+- (void)didReceiveData:(NSData *)data;
+
+/*! @abstract Mark the task as successfully completed.
+ @discussion An exception will be thrown if you try to finish the task before sending it a response.
+ An exception will be thrown if you try to mark a task completed after it has already been marked completed or failed.
+ An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
+ */
+- (void)didFinish;
+
+/*! @abstract Mark the task as failed.
+ @param error A description of the error that caused the task to fail.
+ @discussion  An exception will be thrown if you try to mark a task failed after it has already been marked completed or failed.
+ An exception will be thrown if your app has been told to stop loading this task via the registered WKURLSchemeHandler object.
+ */
+- (void)didFailWithError:(NSError *)error;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.mm (from rev 216036, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.mm	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTask.mm	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKURLSchemeTaskInternal.h"
+
+#if WK_API_ENABLED
+
+#include "WebURLSchemeTask.h"
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceResponse.h>
+#include <WebCore/SharedBuffer.h>
+
+using namespace WebCore;
+
+static void raiseExceptionIfNecessary(WebKit::WebURLSchemeTask::ExceptionType exceptionType)
+{
+    switch (exceptionType) {
+    case WebKit::WebURLSchemeTask::ExceptionType::None:
+        return;
+    case WebKit::WebURLSchemeTask::ExceptionType::TaskAlreadyStopped:
+        [NSException raise:NSInternalInconsistencyException format:@"This task has already been stopped"];
+        break;
+    case WebKit::WebURLSchemeTask::ExceptionType::CompleteAlreadyCalled:
+        [NSException raise:NSInternalInconsistencyException format:@"[WKURLSchemeTask taskDidCompleteWithError:] has already been called for this task"];
+        break;
+    case WebKit::WebURLSchemeTask::ExceptionType::DataAlreadySent:
+        [NSException raise:NSInternalInconsistencyException format:@"[WKURLSchemeTask taskDidReceiveData:] has already been called for this task"];
+        break;
+    case WebKit::WebURLSchemeTask::ExceptionType::NoResponseSent:
+        [NSException raise:NSInternalInconsistencyException format:@"No response has been sent for this task"];
+        break;
+    }
+}
+
+@implementation WKURLSchemeTaskImpl
+
+- (NSURLRequest *)request
+{
+    return _urlSchemeTask->task().request().nsURLRequest(DoNotUpdateHTTPBody);
+}
+
+- (void)didReceiveResponse:(NSURLResponse *)response
+{
+    auto result = _urlSchemeTask->task().didReceiveResponse(response);
+    raiseExceptionIfNecessary(result);
+}
+
+- (void)didReceiveData:(NSData *)data
+{
+    auto result = _urlSchemeTask->task().didReceiveData(WebCore::SharedBuffer::create(data));
+    raiseExceptionIfNecessary(result);
+}
+
+- (void)didFinish
+{
+    auto result = _urlSchemeTask->task().didComplete({ });
+    raiseExceptionIfNecessary(result);
+}
+
+- (void)didFailWithError:(NSError *)error
+{
+    auto result = _urlSchemeTask->task().didComplete(error);
+    raiseExceptionIfNecessary(result);
+}
+
+#pragma mark WKObject protocol implementation
+
+- (API::Object&)_apiObject
+{
+    return *_urlSchemeTask;
+}
+
+@end
+
+#endif // #if WK_API_ENABLED

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h (from rev 216036, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WKURLSchemeTask.h"
+
+#if WK_API_ENABLED
+
+#import "APIURLSchemeTask.h"
+#import "WKObject.h"
+
+@interface WKURLSchemeTaskImpl : NSObject <WKURLSchemeTask>
+@end
+
+namespace WebKit {
+
+inline id<WKURLSchemeTask> wrapper(API::URLSchemeTask& urlSchemeTask)
+{
+    ASSERT([urlSchemeTask.wrapper() isKindOfClass:[WKURLSchemeTaskImpl class]]);
+    return (id<WKURLSchemeTask>)urlSchemeTask.wrapper();
+}
+
+}
+
+@interface WKURLSchemeTaskImpl () <WKObject> {
+@package
+    API::ObjectStorage<API::URLSchemeTask> _urlSchemeTask;
+}
+@end
+
+#endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -31,7 +31,7 @@
 @protocol WKURLSchemeHandler;
 
 namespace API {
-class URLSchemeHandlerTask;
+class URLSchemeTask;
 }
 
 namespace WebKit {
@@ -45,11 +45,11 @@
 private:
     WebURLSchemeHandlerCocoa(id <WKURLSchemeHandler>);
 
-    void platformStartTask(WebPageProxy&, WebURLSchemeHandlerTask&) final;
-    void platformStopTask(WebPageProxy&, WebURLSchemeHandlerTask&) final;
+    void platformStartTask(WebPageProxy&, WebURLSchemeTask&) final;
+    void platformStopTask(WebPageProxy&, WebURLSchemeTask&) final;
 
     RetainPtr<id <WKURLSchemeHandler>> m_apiHandler;
-    HashMap<uint64_t, Ref<API::URLSchemeHandlerTask>> m_apiTasks;
+    HashMap<uint64_t, Ref<API::URLSchemeTask>> m_apiTasks;
 
 }; // class WebURLSchemeHandler
 

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm	2017-05-01 22:41:26 UTC (rev 216037)
@@ -26,12 +26,12 @@
 #import "config.h"
 #import "WebURLSchemeHandlerCocoa.h"
 
-#import "APIURLSchemeHandlerTask.h"
+#import "APIURLSchemeTask.h"
 #import "WKFoundation.h"
 #import "WKURLSchemeHandler.h"
-#import "WKURLSchemeHandlerTaskInternal.h"
+#import "WKURLSchemeTaskInternal.h"
 #import "WKWebViewInternal.h"
-#import "WebURLSchemeHandlerTask.h"
+#import "WebURLSchemeTask.h"
 
 using namespace WebCore;
 
@@ -47,13 +47,13 @@
 {
 }
 
-void WebURLSchemeHandlerCocoa::platformStartTask(WebPageProxy& page, WebURLSchemeHandlerTask& task)
+void WebURLSchemeHandlerCocoa::platformStartTask(WebPageProxy& page, WebURLSchemeTask& task)
 {
 #if WK_API_ENABLED
-    auto result = m_apiTasks.add(task.identifier(), API::URLSchemeHandlerTask::create(task));
+    auto result = m_apiTasks.add(task.identifier(), API::URLSchemeTask::create(task));
     ASSERT(result.isNewEntry);
 
-    [m_apiHandler.get() webView:fromWebPageProxy(page) startTask:wrapper(result.iterator->value.get())];
+    [m_apiHandler.get() webView:fromWebPageProxy(page) startURLSchemeTask:wrapper(result.iterator->value.get())];
 #else
     UNUSED_PARAM(page);
     UNUSED_PARAM(task);
@@ -60,7 +60,7 @@
 #endif
 }
 
-void WebURLSchemeHandlerCocoa::platformStopTask(WebPageProxy& page, WebURLSchemeHandlerTask& task)
+void WebURLSchemeHandlerCocoa::platformStopTask(WebPageProxy& page, WebURLSchemeTask& task)
 {
 #if WK_API_ENABLED
     auto iterator = m_apiTasks.find(task.identifier());
@@ -67,7 +67,7 @@
     if (iterator == m_apiTasks.end())
         return;
 
-    [m_apiHandler.get() webView:fromWebPageProxy(page) stopTask:wrapper(iterator->value.get())];
+    [m_apiHandler.get() webView:fromWebPageProxy(page) stopURLSchemeTask:wrapper(iterator->value.get())];
 
     m_apiTasks.remove(iterator);
 #else

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -6880,7 +6880,7 @@
     return m_urlSchemeHandlersByScheme.get(scheme);
 }
 
-void WebPageProxy::startURLSchemeHandlerTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier, const WebCore::ResourceRequest& request)
+void WebPageProxy::startURLSchemeTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier, const WebCore::ResourceRequest& request)
 {
     auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier);
     ASSERT(iterator != m_urlSchemeHandlersByIdentifier.end());
@@ -6888,7 +6888,7 @@
     iterator->value->startTask(*this, resourceIdentifier, request);
 }
 
-void WebPageProxy::stopURLSchemeHandlerTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier)
+void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier)
 {
     auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier);
     ASSERT(iterator != m_urlSchemeHandlersByIdentifier.end());

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1608,8 +1608,8 @@
 #endif
 #endif
 
-    void startURLSchemeHandlerTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier, const WebCore::ResourceRequest&);
-    void stopURLSchemeHandlerTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier);
+    void startURLSchemeTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier, const WebCore::ResourceRequest&);
+    void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t resourceIdentifier);
 
     void handleAutoFillButtonClick(const UserData&);
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2017-05-01 22:41:26 UTC (rev 216037)
@@ -492,8 +492,8 @@
 
     SetIsUsingHighPerformanceWebGL(bool isUsingHighPerformanceWebGL)
 
-    StartURLSchemeHandlerTask(uint64_t loaderIdentifier, uint64_t resourceIdentifier, WebCore::ResourceRequest request)
-    StopURLSchemeHandlerTask(uint64_t loaderIdentifier, uint64_t resourceIdentifier)
+    StartURLSchemeTask(uint64_t loaderIdentifier, uint64_t resourceIdentifier, WebCore::ResourceRequest request)
+    StopURLSchemeTask(uint64_t loaderIdentifier, uint64_t resourceIdentifier)
 
     SetClipToSafeArea(bool clipToSafeArea)
 }

Modified: trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.cpp (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "WebURLSchemeHandler.h"
 
-#include "WebURLSchemeHandlerTask.h"
+#include "WebURLSchemeTask.h"
 
 using namespace WebCore;
 
@@ -50,7 +50,7 @@
 
 void WebURLSchemeHandler::startTask(WebPageProxy& page, uint64_t resourceIdentifier, const ResourceRequest& request)
 {
-    auto result = m_tasks.add(resourceIdentifier, WebURLSchemeHandlerTask::create(*this, page, resourceIdentifier, request));
+    auto result = m_tasks.add(resourceIdentifier, WebURLSchemeTask::create(*this, page, resourceIdentifier, request));
     ASSERT(result.isNewEntry);
 
     platformStartTask(page, result.iterator->value);

Modified: trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeHandler.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "WebURLSchemeHandlerTask.h"
+#include "WebURLSchemeTask.h"
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -52,12 +52,12 @@
     WebURLSchemeHandler();
 
 private:
-    virtual void platformStartTask(WebPageProxy&, WebURLSchemeHandlerTask&) = 0;
-    virtual void platformStopTask(WebPageProxy&, WebURLSchemeHandlerTask&) = 0;
+    virtual void platformStartTask(WebPageProxy&, WebURLSchemeTask&) = 0;
+    virtual void platformStopTask(WebPageProxy&, WebURLSchemeTask&) = 0;
 
     uint64_t m_identifier;
 
-    HashMap<uint64_t, Ref<WebURLSchemeHandlerTask>> m_tasks;
+    HashMap<uint64_t, Ref<WebURLSchemeTask>> m_tasks;
 
 }; // class WebURLSchemeHandler
 

Deleted: trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebURLSchemeHandlerTask.h"
-
-#include "DataReference.h"
-#include "WebPageMessages.h"
-#include "WebPageProxy.h"
-#include "WebURLSchemeHandler.h"
-
-using namespace WebCore;
-
-namespace WebKit {
-
-Ref<WebURLSchemeHandlerTask> WebURLSchemeHandlerTask::create(WebURLSchemeHandler& handler, WebPageProxy& page, uint64_t resourceIdentifier, const ResourceRequest& request)
-{
-    return adoptRef(*new WebURLSchemeHandlerTask(handler, page, resourceIdentifier, request));
-}
-
-WebURLSchemeHandlerTask::WebURLSchemeHandlerTask(WebURLSchemeHandler& handler, WebPageProxy& page, uint64_t resourceIdentifier, const ResourceRequest& request)
-    : m_urlSchemeHandler(handler)
-    , m_page(&page)
-    , m_identifier(resourceIdentifier)
-    , m_request(request)
-{
-}
-
-WebURLSchemeHandlerTask::ExceptionType WebURLSchemeHandlerTask::didReceiveResponse(const ResourceResponse& response)
-{
-    if (m_stopped)
-        return WebURLSchemeHandlerTask::ExceptionType::TaskAlreadyStopped;
-
-    if (m_completed)
-        return WebURLSchemeHandlerTask::ExceptionType::CompleteAlreadyCalled;
-
-    if (m_dataSent)
-        return WebURLSchemeHandlerTask::ExceptionType::DataAlreadySent;
-
-    m_responseSent = true;
-
-    response.includeCertificateInfo();
-    m_page->send(Messages::WebPage::URLSchemeHandlerTaskDidReceiveResponse(m_urlSchemeHandler->identifier(), m_identifier, response));
-    return WebURLSchemeHandlerTask::ExceptionType::None;
-}
-
-WebURLSchemeHandlerTask::ExceptionType WebURLSchemeHandlerTask::didReceiveData(Ref<SharedBuffer> buffer)
-{
-    if (m_stopped)
-        return WebURLSchemeHandlerTask::ExceptionType::TaskAlreadyStopped;
-
-    if (m_completed)
-        return WebURLSchemeHandlerTask::ExceptionType::CompleteAlreadyCalled;
-
-    if (!m_responseSent)
-        return WebURLSchemeHandlerTask::ExceptionType::NoResponseSent;
-
-    m_dataSent = true;
-    m_page->send(Messages::WebPage::URLSchemeHandlerTaskDidReceiveData(m_urlSchemeHandler->identifier(), m_identifier, IPC::SharedBufferDataReference(buffer.ptr())));
-    return WebURLSchemeHandlerTask::ExceptionType::None;
-}
-
-WebURLSchemeHandlerTask::ExceptionType WebURLSchemeHandlerTask::didComplete(const ResourceError& error)
-{
-    if (m_stopped)
-        return WebURLSchemeHandlerTask::ExceptionType::TaskAlreadyStopped;
-
-    if (m_completed)
-        return WebURLSchemeHandlerTask::ExceptionType::CompleteAlreadyCalled;
-
-    if (!m_responseSent && error.isNull())
-        return WebURLSchemeHandlerTask::ExceptionType::NoResponseSent;
-
-    m_completed = true;
-    m_page->send(Messages::WebPage::URLSchemeHandlerTaskDidComplete(m_urlSchemeHandler->identifier(), m_identifier, error));
-    return WebURLSchemeHandlerTask::ExceptionType::None;
-}
-
-void WebURLSchemeHandlerTask::pageDestroyed()
-{
-    ASSERT(m_page);
-    m_page = nullptr;
-    m_stopped = true;
-}
-
-void WebURLSchemeHandlerTask::stop()
-{
-    ASSERT(!m_stopped);
-    m_stopped = true;
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h (216036 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <WebCore/ResourceRequest.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-class ResourceError;
-class ResourceResponse;
-class SharedBuffer;
-}
-
-namespace WebKit {
-
-class WebURLSchemeHandler;
-class WebPageProxy;
-
-class WebURLSchemeHandlerTask : public RefCounted<WebURLSchemeHandlerTask> {
-    WTF_MAKE_NONCOPYABLE(WebURLSchemeHandlerTask);
-public:
-    static Ref<WebURLSchemeHandlerTask> create(WebURLSchemeHandler&, WebPageProxy&, uint64_t identifier, const WebCore::ResourceRequest&);
-
-    uint64_t identifier() const { return m_identifier; }
-
-    const WebCore::ResourceRequest& request() const { return m_request; }
-
-    enum class ExceptionType {
-        DataAlreadySent,
-        CompleteAlreadyCalled,
-        TaskAlreadyStopped,
-        NoResponseSent,
-        None,
-    };
-    ExceptionType didReceiveResponse(const WebCore::ResourceResponse&);
-    ExceptionType didReceiveData(Ref<WebCore::SharedBuffer>);
-    ExceptionType didComplete(const WebCore::ResourceError&);
-
-    void stop();
-    void pageDestroyed();
-
-private:
-    WebURLSchemeHandlerTask(WebURLSchemeHandler&, WebPageProxy&, uint64_t identifier, const WebCore::ResourceRequest&);
-
-    Ref<WebURLSchemeHandler> m_urlSchemeHandler;
-    WebPageProxy* m_page;
-    uint64_t m_identifier;
-    WebCore::ResourceRequest m_request;
-    bool m_stopped { false };
-    bool m_responseSent { false };
-    bool m_dataSent { false };
-    bool m_completed { false };
-};
-
-} // namespace WebKit

Copied: trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.cpp (from rev 216036, trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebURLSchemeTask.h"
+
+#include "DataReference.h"
+#include "WebPageMessages.h"
+#include "WebPageProxy.h"
+#include "WebURLSchemeHandler.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+Ref<WebURLSchemeTask> WebURLSchemeTask::create(WebURLSchemeHandler& handler, WebPageProxy& page, uint64_t resourceIdentifier, const ResourceRequest& request)
+{
+    return adoptRef(*new WebURLSchemeTask(handler, page, resourceIdentifier, request));
+}
+
+WebURLSchemeTask::WebURLSchemeTask(WebURLSchemeHandler& handler, WebPageProxy& page, uint64_t resourceIdentifier, const ResourceRequest& request)
+    : m_urlSchemeHandler(handler)
+    , m_page(&page)
+    , m_identifier(resourceIdentifier)
+    , m_request(request)
+{
+}
+
+WebURLSchemeTask::ExceptionType WebURLSchemeTask::didReceiveResponse(const ResourceResponse& response)
+{
+    if (m_stopped)
+        return WebURLSchemeTask::ExceptionType::TaskAlreadyStopped;
+
+    if (m_completed)
+        return WebURLSchemeTask::ExceptionType::CompleteAlreadyCalled;
+
+    if (m_dataSent)
+        return WebURLSchemeTask::ExceptionType::DataAlreadySent;
+
+    m_responseSent = true;
+
+    response.includeCertificateInfo();
+    m_page->send(Messages::WebPage::URLSchemeTaskDidReceiveResponse(m_urlSchemeHandler->identifier(), m_identifier, response));
+    return WebURLSchemeTask::ExceptionType::None;
+}
+
+WebURLSchemeTask::ExceptionType WebURLSchemeTask::didReceiveData(Ref<SharedBuffer> buffer)
+{
+    if (m_stopped)
+        return WebURLSchemeTask::ExceptionType::TaskAlreadyStopped;
+
+    if (m_completed)
+        return WebURLSchemeTask::ExceptionType::CompleteAlreadyCalled;
+
+    if (!m_responseSent)
+        return WebURLSchemeTask::ExceptionType::NoResponseSent;
+
+    m_dataSent = true;
+    m_page->send(Messages::WebPage::URLSchemeTaskDidReceiveData(m_urlSchemeHandler->identifier(), m_identifier, IPC::SharedBufferDataReference(buffer.ptr())));
+    return WebURLSchemeTask::ExceptionType::None;
+}
+
+WebURLSchemeTask::ExceptionType WebURLSchemeTask::didComplete(const ResourceError& error)
+{
+    if (m_stopped)
+        return WebURLSchemeTask::ExceptionType::TaskAlreadyStopped;
+
+    if (m_completed)
+        return WebURLSchemeTask::ExceptionType::CompleteAlreadyCalled;
+
+    if (!m_responseSent && error.isNull())
+        return WebURLSchemeTask::ExceptionType::NoResponseSent;
+
+    m_completed = true;
+    m_page->send(Messages::WebPage::URLSchemeTaskDidComplete(m_urlSchemeHandler->identifier(), m_identifier, error));
+    return WebURLSchemeTask::ExceptionType::None;
+}
+
+void WebURLSchemeTask::pageDestroyed()
+{
+    ASSERT(m_page);
+    m_page = nullptr;
+    m_stopped = true;
+}
+
+void WebURLSchemeTask::stop()
+{
+    ASSERT(!m_stopped);
+    m_stopped = true;
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.h (from rev 216036, trunk/Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h) (0 => 216037)


--- trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebURLSchemeTask.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebCore/ResourceRequest.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+class ResourceError;
+class ResourceResponse;
+class SharedBuffer;
+}
+
+namespace WebKit {
+
+class WebURLSchemeHandler;
+class WebPageProxy;
+
+class WebURLSchemeTask : public RefCounted<WebURLSchemeTask> {
+    WTF_MAKE_NONCOPYABLE(WebURLSchemeTask);
+public:
+    static Ref<WebURLSchemeTask> create(WebURLSchemeHandler&, WebPageProxy&, uint64_t identifier, const WebCore::ResourceRequest&);
+
+    uint64_t identifier() const { return m_identifier; }
+
+    const WebCore::ResourceRequest& request() const { return m_request; }
+
+    enum class ExceptionType {
+        DataAlreadySent,
+        CompleteAlreadyCalled,
+        TaskAlreadyStopped,
+        NoResponseSent,
+        None,
+    };
+    ExceptionType didReceiveResponse(const WebCore::ResourceResponse&);
+    ExceptionType didReceiveData(Ref<WebCore::SharedBuffer>);
+    ExceptionType didComplete(const WebCore::ResourceError&);
+
+    void stop();
+    void pageDestroyed();
+
+private:
+    WebURLSchemeTask(WebURLSchemeHandler&, WebPageProxy&, uint64_t identifier, const WebCore::ResourceRequest&);
+
+    Ref<WebURLSchemeHandler> m_urlSchemeHandler;
+    WebPageProxy* m_page;
+    uint64_t m_identifier;
+    WebCore::ResourceRequest m_request;
+    bool m_stopped { false };
+    bool m_responseSent { false };
+    bool m_dataSent { false };
+    bool m_completed { false };
+};
+
+} // namespace WebKit

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (216036 => 216037)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1056,14 +1056,14 @@
 		51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */; };
 		51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */; };
 		51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */; };
-		51D124231E6D34A1002B2820 /* WebURLSchemeHandlerTaskProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124211E6D349A002B2820 /* WebURLSchemeHandlerTaskProxy.cpp */; };
+		51D124231E6D34A1002B2820 /* WebURLSchemeTaskProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124211E6D349A002B2820 /* WebURLSchemeTaskProxy.cpp */; };
 		51D124281E6D3F5D002B2820 /* WebURLSchemeHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */; };
 		51D1242C1E6D41FD002B2820 /* WebURLSchemeHandlerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D1242A1E6D41BC002B2820 /* WebURLSchemeHandlerProxy.cpp */; };
 		51D124331E6DE6CA002B2820 /* WebURLSchemeHandlerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124321E6DE521002B2820 /* WebURLSchemeHandlerCocoa.mm */; };
 		51D124341E6DF643002B2820 /* WKURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D1242D1E6DDDD7002B2820 /* WKURLSchemeHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		51D124351E6DF652002B2820 /* WKURLSchemeHandlerTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D1242F1E6DDDD7002B2820 /* WKURLSchemeHandlerTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		51D124361E6DFB39002B2820 /* WKURLSchemeHandlerTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124301E6DDDD7002B2820 /* WKURLSchemeHandlerTask.mm */; };
-		51D1243A1E6E0AAB002B2820 /* APIURLSchemeHandlerTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */; };
+		51D124351E6DF652002B2820 /* WKURLSchemeTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D1242F1E6DDDD7002B2820 /* WKURLSchemeTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		51D124361E6DFB39002B2820 /* WKURLSchemeTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124301E6DDDD7002B2820 /* WKURLSchemeTask.mm */; };
+		51D1243A1E6E0AAB002B2820 /* APIURLSchemeTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124381E6DFDB9002B2820 /* APIURLSchemeTask.cpp */; };
 		51D124911E74BF3C002B2820 /* APIHTTPCookieStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124821E734AC8002B2820 /* APIHTTPCookieStore.cpp */; };
 		51D124921E74BF48002B2820 /* WKHTTPCookieStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124851E734AE3002B2820 /* WKHTTPCookieStore.mm */; };
 		51D124991E763C01002B2820 /* WKHTTPCookieStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1081,7 +1081,7 @@
 		51E35202180F5D1E00E53BE9 /* DatabaseProcessMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E35201180F5D1E00E53BE9 /* DatabaseProcessMac.mm */; };
 		51E35209180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E35208180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm */; };
 		51E399061D6F54C7009C8831 /* UIGamepadProviderCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E399051D6F54C5009C8831 /* UIGamepadProviderCocoa.mm */; };
-		51E8B68E1E712877001B7132 /* WebURLSchemeHandlerTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E8B68D1E712873001B7132 /* WebURLSchemeHandlerTask.cpp */; };
+		51E8B68E1E712877001B7132 /* WebURLSchemeTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E8B68D1E712873001B7132 /* WebURLSchemeTask.cpp */; };
 		51E949971D76211300EC9EB9 /* UIGamepadProviderIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E949961D761CC700EC9EB9 /* UIGamepadProviderIOS.mm */; };
 		51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FA2D541521118600C1BA0B /* WKBundleDOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F060DE1654317500F3281B /* WebResourceLoaderMessages.h */; };
@@ -3301,21 +3301,21 @@
 		51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseMessages.h; sourceTree = "<group>"; };
 		51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseProxyMessages.h; sourceTree = "<group>"; };
-		51D124211E6D349A002B2820 /* WebURLSchemeHandlerTaskProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeHandlerTaskProxy.cpp; sourceTree = "<group>"; };
-		51D124221E6D349A002B2820 /* WebURLSchemeHandlerTaskProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeHandlerTaskProxy.h; sourceTree = "<group>"; };
+		51D124211E6D349A002B2820 /* WebURLSchemeTaskProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeTaskProxy.cpp; sourceTree = "<group>"; };
+		51D124221E6D349A002B2820 /* WebURLSchemeTaskProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeTaskProxy.h; sourceTree = "<group>"; };
 		51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeHandler.cpp; sourceTree = "<group>"; };
 		51D124251E6D3CC3002B2820 /* WebURLSchemeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeHandler.h; sourceTree = "<group>"; };
-		51D124271E6D3F1F002B2820 /* WebURLSchemeHandlerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeHandlerTask.h; sourceTree = "<group>"; };
+		51D124271E6D3F1F002B2820 /* WebURLSchemeTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeTask.h; sourceTree = "<group>"; };
 		51D1242A1E6D41BC002B2820 /* WebURLSchemeHandlerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeHandlerProxy.cpp; sourceTree = "<group>"; };
 		51D1242B1E6D41BC002B2820 /* WebURLSchemeHandlerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeHandlerProxy.h; sourceTree = "<group>"; };
 		51D1242D1E6DDDD7002B2820 /* WKURLSchemeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeHandler.h; sourceTree = "<group>"; };
-		51D1242F1E6DDDD7002B2820 /* WKURLSchemeHandlerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeHandlerTask.h; sourceTree = "<group>"; };
-		51D124301E6DDDD7002B2820 /* WKURLSchemeHandlerTask.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKURLSchemeHandlerTask.mm; sourceTree = "<group>"; };
+		51D1242F1E6DDDD7002B2820 /* WKURLSchemeTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTask.h; sourceTree = "<group>"; };
+		51D124301E6DDDD7002B2820 /* WKURLSchemeTask.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKURLSchemeTask.mm; sourceTree = "<group>"; };
 		51D124311E6DE521002B2820 /* WebURLSchemeHandlerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLSchemeHandlerCocoa.h; sourceTree = "<group>"; };
 		51D124321E6DE521002B2820 /* WebURLSchemeHandlerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebURLSchemeHandlerCocoa.mm; sourceTree = "<group>"; };
-		51D124371E6DFD2A002B2820 /* WKURLSchemeHandlerTaskInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeHandlerTaskInternal.h; sourceTree = "<group>"; };
-		51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIURLSchemeHandlerTask.cpp; sourceTree = "<group>"; };
-		51D124391E6DFDB9002B2820 /* APIURLSchemeHandlerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIURLSchemeHandlerTask.h; sourceTree = "<group>"; };
+		51D124371E6DFD2A002B2820 /* WKURLSchemeTaskInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskInternal.h; sourceTree = "<group>"; };
+		51D124381E6DFDB9002B2820 /* APIURLSchemeTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIURLSchemeTask.cpp; sourceTree = "<group>"; };
+		51D124391E6DFDB9002B2820 /* APIURLSchemeTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIURLSchemeTask.h; sourceTree = "<group>"; };
 		51D124821E734AC8002B2820 /* APIHTTPCookieStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIHTTPCookieStore.cpp; sourceTree = "<group>"; };
 		51D124831E734AC8002B2820 /* APIHTTPCookieStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIHTTPCookieStore.h; sourceTree = "<group>"; };
 		51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStore.h; sourceTree = "<group>"; };
@@ -3339,7 +3339,7 @@
 		51E35207180F5D6100E53BE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		51E35208180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DatabaseServiceEntryPoint.mm; sourceTree = "<group>"; };
 		51E399051D6F54C5009C8831 /* UIGamepadProviderCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIGamepadProviderCocoa.mm; sourceTree = "<group>"; };
-		51E8B68D1E712873001B7132 /* WebURLSchemeHandlerTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeHandlerTask.cpp; sourceTree = "<group>"; };
+		51E8B68D1E712873001B7132 /* WebURLSchemeTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLSchemeTask.cpp; sourceTree = "<group>"; };
 		51E949961D761CC700EC9EB9 /* UIGamepadProviderIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIGamepadProviderIOS.mm; sourceTree = "<group>"; };
 		51F060DD1654317500F3281B /* WebResourceLoaderMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoaderMessageReceiver.cpp; sourceTree = "<group>"; };
 		51F060DD1654317500F3281C /* WebRTCSocketMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebRTCSocketMessageReceiver.cpp; sourceTree = "<group>"; };
@@ -5682,9 +5682,9 @@
 				1AD8790918B6C38A006CAFD7 /* WKUIDelegate.h */,
 				3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */,
 				51D1242D1E6DDDD7002B2820 /* WKURLSchemeHandler.h */,
-				51D1242F1E6DDDD7002B2820 /* WKURLSchemeHandlerTask.h */,
-				51D124301E6DDDD7002B2820 /* WKURLSchemeHandlerTask.mm */,
-				51D124371E6DFD2A002B2820 /* WKURLSchemeHandlerTaskInternal.h */,
+				51D1242F1E6DDDD7002B2820 /* WKURLSchemeTask.h */,
+				51D124301E6DDDD7002B2820 /* WKURLSchemeTask.mm */,
+				51D124371E6DFD2A002B2820 /* WKURLSchemeTaskInternal.h */,
 				1AFA3AC718E61C61003CCBAE /* WKUserContentController.h */,
 				1AFA3AC618E61C61003CCBAE /* WKUserContentController.mm */,
 				1AAF08A3192682DA00B6390C /* WKUserContentControllerInternal.h */,
@@ -6654,8 +6654,8 @@
 				BCA0EF7D12331E78007D3CFB /* WebUndoStep.h */,
 				51D1242A1E6D41BC002B2820 /* WebURLSchemeHandlerProxy.cpp */,
 				51D1242B1E6D41BC002B2820 /* WebURLSchemeHandlerProxy.h */,
-				51D124211E6D349A002B2820 /* WebURLSchemeHandlerTaskProxy.cpp */,
-				51D124221E6D349A002B2820 /* WebURLSchemeHandlerTaskProxy.h */,
+				51D124211E6D349A002B2820 /* WebURLSchemeTaskProxy.cpp */,
+				51D124221E6D349A002B2820 /* WebURLSchemeTaskProxy.h */,
 			);
 			path = WebPage;
 			sourceTree = "<group>";
@@ -6821,8 +6821,8 @@
 				7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */,
 				51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */,
 				51D124251E6D3CC3002B2820 /* WebURLSchemeHandler.h */,
-				51E8B68D1E712873001B7132 /* WebURLSchemeHandlerTask.cpp */,
-				51D124271E6D3F1F002B2820 /* WebURLSchemeHandlerTask.h */,
+				51E8B68D1E712873001B7132 /* WebURLSchemeTask.cpp */,
+				51D124271E6D3F1F002B2820 /* WebURLSchemeTask.h */,
 			);
 			path = UIProcess;
 			sourceTree = "<group>";
@@ -6879,8 +6879,8 @@
 				1AFDE65F1954E9B100C48FFA /* APISessionState.cpp */,
 				1AFDE6601954E9B100C48FFA /* APISessionState.h */,
 				1A4D664718A2D91A00D82E21 /* APIUIClient.h */,
-				51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */,
-				51D124391E6DFDB9002B2820 /* APIURLSchemeHandlerTask.h */,
+				51D124381E6DFDB9002B2820 /* APIURLSchemeTask.cpp */,
+				51D124391E6DFDB9002B2820 /* APIURLSchemeTask.h */,
 				7C882DFB1C7E99A6006BF731 /* APIUserContentWorld.cpp */,
 				7C882DFC1C7E99A6006BF731 /* APIUserContentWorld.h */,
 				7CB365AF1D31DD1E007158CA /* APIUserInitiatedAction.h */,
@@ -9051,7 +9051,7 @@
 				BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */,
 				BC40762B124FF0400068F20A /* WKURLResponseNS.h in Headers */,
 				51D124341E6DF643002B2820 /* WKURLSchemeHandler.h in Headers */,
-				51D124351E6DF652002B2820 /* WKURLSchemeHandlerTask.h in Headers */,
+				51D124351E6DF652002B2820 /* WKURLSchemeTask.h in Headers */,
 				1AFA3AC918E61C61003CCBAE /* WKUserContentController.h in Headers */,
 				1AAF08A4192682DA00B6390C /* WKUserContentControllerInternal.h in Headers */,
 				7C89D2B61A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h in Headers */,
@@ -9763,7 +9763,7 @@
 				1AFDE6611954E9B100C48FFA /* APISessionState.cpp in Sources */,
 				BCE2315E122C30CA00D5C35A /* APIURLRequest.cpp in Sources */,
 				BC90A1D3122DD55E00CC8C50 /* APIURLResponse.cpp in Sources */,
-				51D1243A1E6E0AAB002B2820 /* APIURLSchemeHandlerTask.cpp in Sources */,
+				51D1243A1E6E0AAB002B2820 /* APIURLSchemeTask.cpp in Sources */,
 				7CEFA9621AC0999300B910FD /* APIUserContentExtensionStoreCocoa.mm in Sources */,
 				7C882DFE1C7E99AC006BF731 /* APIUserContentWorld.cpp in Sources */,
 				7C89D2A61A6789EA003A5FDE /* APIUserScript.cpp in Sources */,
@@ -10380,8 +10380,8 @@
 				63C32C251E9810D900699BD0 /* _WKGeolocationPosition.mm in Sources */,
 				51D124331E6DE6CA002B2820 /* WebURLSchemeHandlerCocoa.mm in Sources */,
 				51D1242C1E6D41FD002B2820 /* WebURLSchemeHandlerProxy.cpp in Sources */,
-				51E8B68E1E712877001B7132 /* WebURLSchemeHandlerTask.cpp in Sources */,
-				51D124231E6D34A1002B2820 /* WebURLSchemeHandlerTaskProxy.cpp in Sources */,
+				51E8B68E1E712877001B7132 /* WebURLSchemeTask.cpp in Sources */,
+				51D124231E6D34A1002B2820 /* WebURLSchemeTaskProxy.cpp in Sources */,
 				1AAF08AD1926936700B6390C /* WebUserContentController.cpp in Sources */,
 				7C065F2B1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.cpp in Sources */,
 				1AAF08B719269E6D00B6390C /* WebUserContentControllerMessageReceiver.cpp in Sources */,
@@ -10575,7 +10575,7 @@
 				BC40762A124FF0400068F20A /* WKURLRequestNS.mm in Sources */,
 				BC40760D124FF0270068F20A /* WKURLResponse.cpp in Sources */,
 				BC40762C124FF0400068F20A /* WKURLResponseNS.mm in Sources */,
-				51D124361E6DFB39002B2820 /* WKURLSchemeHandlerTask.mm in Sources */,
+				51D124361E6DFB39002B2820 /* WKURLSchemeTask.mm in Sources */,
 				1AFA3AC818E61C61003CCBAE /* WKUserContentController.mm in Sources */,
 				7C89D29F1A678554003A5FDE /* WKUserContentControllerRef.cpp in Sources */,
 				7C2413081AACFCB400A58C15 /* WKUserContentExtensionStoreRef.cpp in Sources */,

Modified: trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -43,7 +43,7 @@
 #include "WebProcess.h"
 #include "WebResourceLoader.h"
 #include "WebURLSchemeHandlerProxy.h"
-#include "WebURLSchemeHandlerTaskProxy.h"
+#include "WebURLSchemeTaskProxy.h"
 #include <WebCore/ApplicationCacheHost.h>
 #include <WebCore/CachedResource.h>
 #include <WebCore/DiagnosticLoggingClient.h>
@@ -263,15 +263,15 @@
     m_webResourceLoaders.set(resourceLoader.identifier(), WebResourceLoader::create(resourceLoader, { }));
 }
 
-void WebLoaderStrategy::addURLSchemeHandlerTaskProxy(WebURLSchemeHandlerTaskProxy& task)
+void WebLoaderStrategy::addURLSchemeTaskProxy(WebURLSchemeTaskProxy& task)
 {
-    auto result = m_urlSchemeHandlerTasks.add(task.identifier(), &task);
+    auto result = m_urlSchemeTasks.add(task.identifier(), &task);
     ASSERT_UNUSED(result, result.isNewEntry);
 }
 
-void WebLoaderStrategy::removeURLSchemeHandlerTaskProxy(WebURLSchemeHandlerTaskProxy& task)
+void WebLoaderStrategy::removeURLSchemeTaskProxy(WebURLSchemeTaskProxy& task)
 {
-    m_urlSchemeHandlerTasks.remove(task.identifier());
+    m_urlSchemeTasks.remove(task.identifier());
 }
 
 void WebLoaderStrategy::remove(ResourceLoader* resourceLoader)
@@ -279,7 +279,7 @@
     ASSERT(resourceLoader);
     LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::remove, url '%s'", resourceLoader->url().string().utf8().data());
 
-    if (auto task = m_urlSchemeHandlerTasks.take(resourceLoader->identifier())) {
+    if (auto task = m_urlSchemeTasks.take(resourceLoader->identifier())) {
         ASSERT(!m_internallyFailedResourceLoaders.contains(resourceLoader));
         task->stopLoading();
         return;

Modified: trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -34,7 +34,7 @@
 namespace WebKit {
 
 class NetworkProcessConnection;
-class WebURLSchemeHandlerTaskProxy;
+class WebURLSchemeTaskProxy;
 typedef uint64_t ResourceLoadIdentifier;
 
 class WebLoaderStrategy : public WebCore::LoaderStrategy {
@@ -66,8 +66,8 @@
 
     void networkProcessCrashed();
 
-    void addURLSchemeHandlerTaskProxy(WebURLSchemeHandlerTaskProxy&);
-    void removeURLSchemeHandlerTaskProxy(WebURLSchemeHandlerTaskProxy&);
+    void addURLSchemeTaskProxy(WebURLSchemeTaskProxy&);
+    void removeURLSchemeTaskProxy(WebURLSchemeTaskProxy&);
 
 private:
     void scheduleLoad(WebCore::ResourceLoader&, WebCore::CachedResource*, bool shouldClearReferrerOnHTTPSToHTTPRedirect);
@@ -79,7 +79,7 @@
     RunLoop::Timer<WebLoaderStrategy> m_internallyFailedLoadTimer;
     
     HashMap<unsigned long, RefPtr<WebResourceLoader>> m_webResourceLoaders;
-    HashMap<unsigned long, WebURLSchemeHandlerTaskProxy*> m_urlSchemeHandlerTasks;
+    HashMap<unsigned long, WebURLSchemeTaskProxy*> m_urlSchemeTasks;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -5858,7 +5858,7 @@
     ASSERT_UNUSED(identifierResult, identifierResult.isNewEntry);
 }
 
-void WebPage::urlSchemeHandlerTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const ResourceResponse& response)
+void WebPage::urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const ResourceResponse& response)
 {
     auto* handler = m_identifierToURLSchemeHandlerProxyMap.get(handlerIdentifier);
     ASSERT(handler);
@@ -5866,7 +5866,7 @@
     handler->taskDidReceiveResponse(taskIdentifier, response);
 }
 
-void WebPage::urlSchemeHandlerTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference& data)
+void WebPage::urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference& data)
 {
     auto* handler = m_identifierToURLSchemeHandlerProxyMap.get(handlerIdentifier);
     ASSERT(handler);
@@ -5874,7 +5874,7 @@
     handler->taskDidReceiveData(taskIdentifier, data.size(), data.data());
 }
 
-void WebPage::urlSchemeHandlerTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const ResourceError& error)
+void WebPage::urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const ResourceError& error)
 {
     auto* handler = m_identifierToURLSchemeHandlerProxyMap.get(handlerIdentifier);
     ASSERT(handler);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1270,9 +1270,9 @@
 
     void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
 
-    void urlSchemeHandlerTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
-    void urlSchemeHandlerTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
-    void urlSchemeHandlerTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
+    void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
+    void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
+    void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
 
     RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
     RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2017-05-01 22:41:26 UTC (rev 216037)
@@ -472,7 +472,7 @@
 
     RegisterURLSchemeHandler(uint64_t identifier, String scheme)
 
-    URLSchemeHandlerTaskDidReceiveResponse(uint64_t providerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse response)
-    URLSchemeHandlerTaskDidReceiveData(uint64_t providerIdentifier, uint64_t taskIdentifier, IPC::DataReference data)
-    URLSchemeHandlerTaskDidComplete(uint64_t providerIdentifier, uint64_t taskIdentifier, WebCore::ResourceError error)
+    URLSchemeTaskDidReceiveResponse(uint64_t providerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse response)
+    URLSchemeTaskDidReceiveData(uint64_t providerIdentifier, uint64_t taskIdentifier, IPC::DataReference data)
+    URLSchemeTaskDidComplete(uint64_t providerIdentifier, uint64_t taskIdentifier, WebCore::ResourceError error)
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -48,10 +48,10 @@
 
 void WebURLSchemeHandlerProxy::startNewTask(ResourceLoader& loader)
 {
-    auto result = m_tasks.add(loader.identifier(), std::make_unique<WebURLSchemeHandlerTaskProxy>(*this, loader));
+    auto result = m_tasks.add(loader.identifier(), std::make_unique<WebURLSchemeTaskProxy>(*this, loader));
     ASSERT(result.isNewEntry);
 
-    WebProcess::singleton().webLoaderStrategy().addURLSchemeHandlerTaskProxy(*result.iterator->value);
+    WebProcess::singleton().webLoaderStrategy().addURLSchemeTaskProxy(*result.iterator->value);
     result.iterator->value->startLoading();
 }
 
@@ -80,11 +80,11 @@
     if (!task)
         return;
 
-    WebProcess::singleton().webLoaderStrategy().removeURLSchemeHandlerTaskProxy(*task);
+    WebProcess::singleton().webLoaderStrategy().removeURLSchemeTaskProxy(*task);
     task->didComplete(error);
 }
 
-void WebURLSchemeHandlerProxy::taskDidStopLoading(WebURLSchemeHandlerTaskProxy& task)
+void WebURLSchemeHandlerProxy::taskDidStopLoading(WebURLSchemeTaskProxy& task)
 {
     ASSERT(m_tasks.get(task.identifier()) == &task);
     m_tasks.remove(task.identifier());

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.h (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerProxy.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "WebURLSchemeHandlerTaskProxy.h"
+#include "WebURLSchemeTaskProxy.h"
 #include <wtf/HashMap.h>
 
 namespace WebCore {
@@ -52,13 +52,13 @@
     void taskDidReceiveResponse(uint64_t taskIdentifier, const WebCore::ResourceResponse&);
     void taskDidReceiveData(uint64_t taskIdentifier, size_t, const uint8_t* data);
     void taskDidComplete(uint64_t taskIdentifier, const WebCore::ResourceError&);
-    void taskDidStopLoading(WebURLSchemeHandlerTaskProxy&);
+    void taskDidStopLoading(WebURLSchemeTaskProxy&);
 
 private:
     WebPage& m_webPage;
     uint64_t m_identifier { 0 };
 
-    HashMap<unsigned long, std::unique_ptr<WebURLSchemeHandlerTaskProxy>> m_tasks;
+    HashMap<unsigned long, std::unique_ptr<WebURLSchemeTaskProxy>> m_tasks;
 }; // class WebURLSchemeHandlerProxy
 
 } // namespace WebKit

Deleted: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebURLSchemeHandlerTaskProxy.h"
-
-#include "WebPage.h"
-#include "WebPageProxyMessages.h"
-#include "WebURLSchemeHandlerProxy.h"
-#include <WebCore/NetworkLoadMetrics.h>
-#include <WebCore/ResourceError.h>
-#include <WebCore/ResourceLoader.h>
-#include <wtf/CurrentTime.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy(WebURLSchemeHandlerProxy& handler, ResourceLoader& loader)
-    : m_urlSchemeHandler(handler)
-    , m_coreLoader(&loader)
-    , m_request(loader.request())
-    , m_identifier(loader.identifier())
-{
-}
-
-void WebURLSchemeHandlerTaskProxy::startLoading()
-{
-    ASSERT(m_coreLoader);
-    m_urlSchemeHandler.page().send(Messages::WebPageProxy::StartURLSchemeHandlerTask(m_urlSchemeHandler.identifier(), m_coreLoader->identifier(), m_request));
-}
-
-void WebURLSchemeHandlerTaskProxy::stopLoading()
-{
-    ASSERT(m_coreLoader);
-    m_urlSchemeHandler.page().send(Messages::WebPageProxy::StopURLSchemeHandlerTask(m_urlSchemeHandler.identifier(), m_coreLoader->identifier()));
-    m_coreLoader = nullptr;
-
-    // This line will result in this being deleted.
-    m_urlSchemeHandler.taskDidStopLoading(*this);
-}
-
-void WebURLSchemeHandlerTaskProxy::didReceiveResponse(const ResourceResponse& response)
-{
-    if (!hasLoader())
-        return;
-
-    m_coreLoader->didReceiveResponse(response);
-}
-
-void WebURLSchemeHandlerTaskProxy::didReceiveData(size_t size, const uint8_t* data)
-{
-    if (!hasLoader())
-        return;
-
-    m_coreLoader->didReceiveData(reinterpret_cast<const char*>(data), size, 0, DataPayloadType::DataPayloadBytes);
-}
-
-void WebURLSchemeHandlerTaskProxy::didComplete(const ResourceError& error)
-{
-    if (!hasLoader())
-        return;
-
-    if (error.isNull())
-        m_coreLoader->didFinishLoading(NetworkLoadMetrics());
-    else
-        m_coreLoader->didFail(error);
-
-    m_coreLoader = nullptr;
-}
-
-bool WebURLSchemeHandlerTaskProxy::hasLoader()
-{
-    if (m_coreLoader && m_coreLoader->reachedTerminalState())
-        m_coreLoader = nullptr;
-
-    return m_coreLoader;
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h (216036 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <WebCore/ResourceRequest.h>
-
-namespace WebCore {
-class ResourceError;
-class ResourceLoader;
-class ResourceResponse;
-}
-
-namespace WebKit {
-
-class WebURLSchemeHandlerProxy;
-
-class WebURLSchemeHandlerTaskProxy {
-    WTF_MAKE_NONCOPYABLE(WebURLSchemeHandlerTaskProxy);
-public:
-    WebURLSchemeHandlerTaskProxy(WebURLSchemeHandlerProxy&, WebCore::ResourceLoader&);
-
-    const WebCore::ResourceRequest& request() const { return m_request; }
-
-    void startLoading();
-    void stopLoading();
-
-    void didReceiveResponse(const WebCore::ResourceResponse&);
-    void didReceiveData(size_t, const uint8_t* data);
-    void didComplete(const WebCore::ResourceError&);
-
-    unsigned long identifier() const { return m_identifier; }
-
-private:
-    bool hasLoader();
-
-    WebURLSchemeHandlerProxy& m_urlSchemeHandler;
-    RefPtr<WebCore::ResourceLoader> m_coreLoader;
-    WebCore::ResourceRequest m_request;
-    unsigned long m_identifier;
-};
-
-} // namespace WebKit

Copied: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.cpp (from rev 216036, trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp) (0 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.cpp	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebURLSchemeTaskProxy.h"
+
+#include "WebPage.h"
+#include "WebPageProxyMessages.h"
+#include "WebURLSchemeHandlerProxy.h"
+#include <WebCore/NetworkLoadMetrics.h>
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceLoader.h>
+#include <wtf/CurrentTime.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebURLSchemeTaskProxy::WebURLSchemeTaskProxy(WebURLSchemeHandlerProxy& handler, ResourceLoader& loader)
+    : m_urlSchemeHandler(handler)
+    , m_coreLoader(&loader)
+    , m_request(loader.request())
+    , m_identifier(loader.identifier())
+{
+}
+
+void WebURLSchemeTaskProxy::startLoading()
+{
+    ASSERT(m_coreLoader);
+    m_urlSchemeHandler.page().send(Messages::WebPageProxy::StartURLSchemeTask(m_urlSchemeHandler.identifier(), m_coreLoader->identifier(), m_request));
+}
+
+void WebURLSchemeTaskProxy::stopLoading()
+{
+    ASSERT(m_coreLoader);
+    m_urlSchemeHandler.page().send(Messages::WebPageProxy::StopURLSchemeTask(m_urlSchemeHandler.identifier(), m_coreLoader->identifier()));
+    m_coreLoader = nullptr;
+
+    // This line will result in this being deleted.
+    m_urlSchemeHandler.taskDidStopLoading(*this);
+}
+
+void WebURLSchemeTaskProxy::didReceiveResponse(const ResourceResponse& response)
+{
+    if (!hasLoader())
+        return;
+
+    m_coreLoader->didReceiveResponse(response);
+}
+
+void WebURLSchemeTaskProxy::didReceiveData(size_t size, const uint8_t* data)
+{
+    if (!hasLoader())
+        return;
+
+    m_coreLoader->didReceiveData(reinterpret_cast<const char*>(data), size, 0, DataPayloadType::DataPayloadBytes);
+}
+
+void WebURLSchemeTaskProxy::didComplete(const ResourceError& error)
+{
+    if (!hasLoader())
+        return;
+
+    if (error.isNull())
+        m_coreLoader->didFinishLoading(NetworkLoadMetrics());
+    else
+        m_coreLoader->didFail(error);
+
+    m_coreLoader = nullptr;
+}
+
+bool WebURLSchemeTaskProxy::hasLoader()
+{
+    if (m_coreLoader && m_coreLoader->reachedTerminalState())
+        m_coreLoader = nullptr;
+
+    return m_coreLoader;
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.h (from rev 216036, trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h) (0 => 216037)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebURLSchemeTaskProxy.h	2017-05-01 22:41:26 UTC (rev 216037)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebCore/ResourceRequest.h>
+
+namespace WebCore {
+class ResourceError;
+class ResourceLoader;
+class ResourceResponse;
+}
+
+namespace WebKit {
+
+class WebURLSchemeHandlerProxy;
+
+class WebURLSchemeTaskProxy {
+    WTF_MAKE_NONCOPYABLE(WebURLSchemeTaskProxy);
+public:
+    WebURLSchemeTaskProxy(WebURLSchemeHandlerProxy&, WebCore::ResourceLoader&);
+
+    const WebCore::ResourceRequest& request() const { return m_request; }
+
+    void startLoading();
+    void stopLoading();
+
+    void didReceiveResponse(const WebCore::ResourceResponse&);
+    void didReceiveData(size_t, const uint8_t* data);
+    void didComplete(const WebCore::ResourceError&);
+
+    unsigned long identifier() const { return m_identifier; }
+
+private:
+    bool hasLoader();
+
+    WebURLSchemeHandlerProxy& m_urlSchemeHandler;
+    RefPtr<WebCore::ResourceLoader> m_coreLoader;
+    WebCore::ResourceRequest m_request;
+    unsigned long m_identifier;
+};
+
+} // namespace WebKit

Modified: trunk/Tools/ChangeLog (216036 => 216037)


--- trunk/Tools/ChangeLog	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Tools/ChangeLog	2017-05-01 22:41:26 UTC (rev 216037)
@@ -1,3 +1,16 @@
+2017-05-01  Brady Eidson  <[email protected]>
+
+        Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
+        <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
+
+        Reviewed by Andy Estes.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
+        (-[SchemeHandler webView:startURLSchemeTask:]):
+        (-[SchemeHandler webView:stopURLSchemeTask:]):
+        (-[SchemeHandler webView:startTask:]): Deleted.
+        (-[SchemeHandler webView:stopTask:]): Deleted.
+
 2017-05-01  Jason Marcell  <[email protected]>
 
         Add a new function for getting the Git hash for a pure git directory.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm (216036 => 216037)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm	2017-05-01 22:29:21 UTC (rev 216036)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm	2017-05-01 22:41:26 UTC (rev 216037)
@@ -28,7 +28,7 @@
 #import "PlatformUtilities.h"
 #import "Test.h"
 #import <WebKit/WKURLSchemeHandler.h>
-#import <WebKit/WKURLSchemeHandlerTask.h>
+#import <WebKit/WKURLSchemeTask.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WebKit.h>
 #import <wtf/RetainPtr.h>
@@ -69,7 +69,7 @@
     [super dealloc];
 }
 
-- (void)webView:(WKWebView *)webView startTask:(id <WKURLSchemeHandlerTask>)task
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)task
 {
     [_startedURLs addObject:task.request.URL];
 
@@ -86,7 +86,7 @@
     [task didFinish];
 }
 
-- (void)webView:(WKWebView *)webView stopTask:(id <WKURLSchemeHandlerTask>)task
+- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id <WKURLSchemeTask>)task
 {
     [_stoppedURLs addObject:task.request.URL];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to