Move PingHandle to WebKitLegacy
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 22:28:25 +0000 (22:28 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 22:28:25 +0000 (22:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184145

Reviewed by Youenn Fablet.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* platform/network/PingHandle.h: Removed.

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:

Source/WebKitLegacy:

* WebCoreSupport/PingHandle.h: Copied from Source/WebCore/platform/network/PingHandle.h.
(): Deleted.
* WebCoreSupport/WebResourceLoadScheduler.cpp:
* WebKitLegacy.xcodeproj/project.pbxproj:

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebCoreSupport/PingHandle.h [moved from Source/WebCore/platform/network/PingHandle.h with 54% similarity]
Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp
Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj

index 090bebb..f2a96c1 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-04  Alex Christensen  <achristensen@webkit.org>
+
+        Move PingHandle to WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=184145
+
+        Reviewed by Youenn Fablet.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/network/PingHandle.h: Removed.
+
 2018-04-04  Per Arne Vollan  <pvollan@apple.com>
 
         The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
index 850b857..690b9e9 100644 (file)
                51A9D9EA195B931F001B2B5C /* GamepadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A9D9E8195B931F001B2B5C /* GamepadManager.h */; };
                51ABAE1E103C1913008C5260 /* SocketStreamHandleImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABAE1C103C1913008C5260 /* SocketStreamHandleImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               51B454EA1B4DAE7D0085EAA6 /* PingHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B454E91B4DAE7D0085EAA6 /* PingHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51B45D211AB8D1E200117CD2 /* ContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B45D1F1AB8D1E200117CD2 /* ContentExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51B914101FD2782D00EE2859 /* RegistrationDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B9140C1FD2782500EE2859 /* RegistrationDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51B914111FD2782D00EE2859 /* RegistrationStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B9140B1FD2782500EE2859 /* RegistrationStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoaderStrategy.cpp; sourceTree = "<group>"; };
                51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderTypes.h; sourceTree = "<group>"; };
                51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyWebArchiveMac.mm; sourceTree = "<group>"; };
-               51B454E91B4DAE7D0085EAA6 /* PingHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PingHandle.h; sourceTree = "<group>"; };
                51B45D1E1AB8D1E200117CD2 /* ContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtension.cpp; sourceTree = "<group>"; };
                51B45D1F1AB8D1E200117CD2 /* ContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtension.h; sourceTree = "<group>"; };
                51B9140B1FD2782500EE2859 /* RegistrationStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegistrationStore.h; sourceTree = "<group>"; };
                                CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */,
                                447958021643B47B001E0A7F /* ParsedContentType.cpp */,
                                447958031643B47B001E0A7F /* ParsedContentType.h */,
-                               51B454E91B4DAE7D0085EAA6 /* PingHandle.h */,
                                E1424C89164B3B4E00F32D40 /* PlatformCookieJar.h */,
                                37BAAE571980D1DD005DFE71 /* ProtectionSpace.h */,
                                514C765F0CE923A1007EF3CD /* ProtectionSpaceBase.cpp */,
                                A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */,
                                FD581FB51520F93B003A7A75 /* PeriodicWave.h in Headers */,
                                49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */,
-                               51B454EA1B4DAE7D0085EAA6 /* PingHandle.h in Headers */,
                                D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */,
                                CD7D33441C7A123F00041293 /* PixelBufferConformerCV.h in Headers */,
                                CDEFA2281E7669E8000AE99C /* PlatformAudioData.h in Headers */,
index 1e2fd46..5ba62e1 100644 (file)
@@ -1,3 +1,12 @@
+2018-04-04  Alex Christensen  <achristensen@webkit.org>
+
+        Move PingHandle to WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=184145
+
+        Reviewed by Youenn Fablet.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+
 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
 
         Failures from mach port reference handling should be fatal
index aec3ec5..19e22ba 100644 (file)
@@ -51,7 +51,6 @@
 #include "WebsiteDataStore.h"
 #include "WebsiteDataStoreParameters.h"
 #include <WebCore/NetworkStorageSession.h>
-#include <WebCore/PingHandle.h>
 #include <WebCore/PlatformCookieJar.h>
 #include <WebCore/ResourceLoaderOptions.h>
 #include <WebCore/ResourceRequest.h>
index 0d93e45..066c038 100644 (file)
@@ -1,3 +1,15 @@
+2018-04-04  Alex Christensen  <achristensen@webkit.org>
+
+        Move PingHandle to WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=184145
+
+        Reviewed by Youenn Fablet.
+
+        * WebCoreSupport/PingHandle.h: Copied from Source/WebCore/platform/network/PingHandle.h.
+        (): Deleted.
+        * WebCoreSupport/WebResourceLoadScheduler.cpp:
+        * WebKitLegacy.xcodeproj/project.pbxproj:
+
 2018-03-27  Chris Dumez  <cdumez@apple.com>
 
         Move online state detection from the WebProcess to the NetworkProcess
 
 #pragma once
 
-#include "ResourceHandle.h"
-#include "ResourceHandleClient.h"
-#include "Timer.h"
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceHandle.h>
+#include <WebCore/ResourceHandleClient.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+#include <WebCore/Timer.h>
 #include <wtf/CompletionHandler.h>
 
-namespace WebCore {
-
 // This class triggers asynchronous loads independent of the networking context staying alive (i.e., auditing pingbacks).
 // The object just needs to live long enough to ensure the message was actually sent.
 // As soon as any callback is received from the ResourceHandle, this class will cancel the load and delete itself.
 
-class PingHandle final : private ResourceHandleClient {
+class PingHandle final : private WebCore::ResourceHandleClient {
     WTF_MAKE_NONCOPYABLE(PingHandle); WTF_MAKE_FAST_ALLOCATED;
 public:
-    PingHandle(NetworkingContext* networkingContext, const ResourceRequest& request, bool shouldUseCredentialStorage, bool shouldFollowRedirects, WTF::CompletionHandler<void(const ResourceError&, const ResourceResponse&)>&& completionHandler)
+    PingHandle(WebCore::NetworkingContext* networkingContext, const WebCore::ResourceRequest& request, bool shouldUseCredentialStorage, bool shouldFollowRedirects, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&& completionHandler)
         : m_currentRequest(request)
         , m_timeoutTimer(*this, &PingHandle::timeoutTimerFired)
         , m_shouldUseCredentialStorage(shouldUseCredentialStorage)
@@ -49,7 +50,7 @@ public:
         bool defersLoading = false;
         bool shouldContentSniff = false;
         bool shouldContentEncodingSniff = true;
-        m_handle = ResourceHandle::create(networkingContext, request, this, defersLoading, shouldContentSniff, shouldContentEncodingSniff);
+        m_handle = WebCore::ResourceHandle::create(networkingContext, request, this, defersLoading, shouldContentSniff, shouldContentEncodingSniff);
 
         // If the server never responds, this object will hang around forever.
         // Set a very generous timeout, just in case.
@@ -57,35 +58,35 @@ public:
     }
 
 private:
-    void willSendRequestAsync(ResourceHandle*, ResourceRequest&& request, ResourceResponse&&, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) final
+    void willSendRequestAsync(WebCore::ResourceHandle*, WebCore::ResourceRequest&& request, WebCore::ResourceResponse&&, CompletionHandler<void(WebCore::ResourceRequest&&)>&& completionHandler) final
     {
         m_currentRequest = WTFMove(request);
         if (m_shouldFollowRedirects) {
-            completionHandler(ResourceRequest { m_currentRequest });
+            completionHandler(WebCore::ResourceRequest { m_currentRequest });
             return;
         }
         completionHandler({ });
-        pingLoadComplete(ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Not allowed to follow redirects"), ResourceError::Type::AccessControl });
+        pingLoadComplete(WebCore::ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Not allowed to follow redirects"), WebCore::ResourceError::Type::AccessControl });
     }
-    void didReceiveResponseAsync(ResourceHandle*, ResourceResponse&& response, CompletionHandler<void()>&& completionHandler) final
+    void didReceiveResponseAsync(WebCore::ResourceHandle*, WebCore::ResourceResponse&& response, CompletionHandler<void()>&& completionHandler) final
     {
         completionHandler();
         pingLoadComplete({ }, response);
     }
-    void didReceiveBuffer(ResourceHandle*, Ref<SharedBuffer>&&, int) final { pingLoadComplete(); }
-    void didFinishLoading(ResourceHandle*) final { pingLoadComplete(); }
-    void didFail(ResourceHandle*, const ResourceError& error) final { pingLoadComplete(error); }
-    bool shouldUseCredentialStorage(ResourceHandle*) final { return m_shouldUseCredentialStorage; }
-    void timeoutTimerFired() { pingLoadComplete(ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Load timed out"), ResourceError::Type::Timeout }); }
+    void didReceiveBuffer(WebCore::ResourceHandle*, Ref<WebCore::SharedBuffer>&&, int) final { pingLoadComplete(); }
+    void didFinishLoading(WebCore::ResourceHandle*) final { pingLoadComplete(); }
+    void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError& error) final { pingLoadComplete(error); }
+    bool shouldUseCredentialStorage(WebCore::ResourceHandle*) final { return m_shouldUseCredentialStorage; }
+    void timeoutTimerFired() { pingLoadComplete(WebCore::ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Load timed out"), WebCore::ResourceError::Type::Timeout }); }
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle*, const ProtectionSpace&, CompletionHandler<void(bool)>&& completionHandler)
+    void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&, CompletionHandler<void(bool)>&& completionHandler)
     {
         completionHandler(false);
-        pingLoadComplete(ResourceError { String { }, 0, m_currentRequest.url(), ASCIILiteral("Not allowed to authenticate"), ResourceError::Type::AccessControl });
+        pingLoadComplete(WebCore::ResourceError { String { }, 0, m_currentRequest.url(), ASCIILiteral("Not allowed to authenticate"), WebCore::ResourceError::Type::AccessControl });
     }
 #endif
 
-    void pingLoadComplete(const ResourceError& error = { }, const ResourceResponse& response = { })
+    void pingLoadComplete(const WebCore::ResourceError& error = { }, const WebCore::ResourceResponse& response = { })
     {
         if (auto completionHandler = std::exchange(m_completionHandler, nullptr))
             completionHandler(error, response);
@@ -102,12 +103,10 @@ private:
         }
     }
 
-    RefPtr<ResourceHandle> m_handle;
-    ResourceRequest m_currentRequest;
-    Timer m_timeoutTimer;
+    RefPtr<WebCore::ResourceHandle> m_handle;
+    WebCore::ResourceRequest m_currentRequest;
+    WebCore::Timer m_timeoutTimer;
     bool m_shouldUseCredentialStorage;
     bool m_shouldFollowRedirects;
-    WTF::CompletionHandler<void(const ResourceError&, const ResourceResponse&)> m_completionHandler;
+    CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)> m_completionHandler;
 };
-
-} // namespace WebCore
index 1df7c34..b4735f9 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "WebResourceLoadScheduler.h"
 
+#include "PingHandle.h"
 #include <WebCore/Document.h>
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/FetchOptions.h>
@@ -31,7 +32,6 @@
 #include <WebCore/FrameLoader.h>
 #include <WebCore/NetscapePlugInStreamLoader.h>
 #include <WebCore/NetworkStateNotifier.h>
-#include <WebCore/PingHandle.h>
 #include <WebCore/PlatformStrategies.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/SubresourceLoader.h>
index 6c42a74..cb91cc3 100644 (file)
                598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */; };
                598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */; };
                598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE44F49206D70E9003EFD01 /* PingHandle.h */; };
                5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
                5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; };
                598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDeviceOrientationProviderMock.mm; sourceTree = "<group>"; };
                598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMockInternal.h; sourceTree = "<group>"; };
                598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProvider.h; sourceTree = "<group>"; };
+               5CE44F49206D70E9003EFD01 /* PingHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PingHandle.h; path = WebCoreSupport/PingHandle.h; sourceTree = SOURCE_ROOT; };
                5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
                5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
                5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; };
                                A10C1D4418202FFB0036883A /* ios */,
                                B82958D1132707D0000D0E79 /* CorrectionPanel.h */,
                                B82958D2132707D0000D0E79 /* CorrectionPanel.mm */,
+                               5CE44F49206D70E9003EFD01 /* PingHandle.h */,
                                7C01CB81173435C900C5D807 /* PopupMenuMac.h */,
                                7C01CB82173435C900C5D807 /* PopupMenuMac.mm */,
                                7C01CB83173435C900C5D807 /* SearchPopupMenuMac.h */,
                                1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */,
                                93D4379B1D57ABEF00AB85EA /* ObjCEventListener.h in Headers */,
                                93D4379D1D57ABEF00AB85EA /* ObjCNodeFilterCondition.h in Headers */,
+                               5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */,
                                A10C1D5F1820300E0036883A /* PopupMenuIOS.h in Headers */,
                                7C01CB85173435C900C5D807 /* PopupMenuMac.h in Headers */,
                                1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,