Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (202929 => 202930)
--- trunk/Source/WebCore/CMakeLists.txt 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1034,7 +1034,6 @@
Modules/webdatabase/SQLTransactionCoordinator.cpp
Modules/webdatabase/SQLTransactionStateMachine.cpp
- Modules/websockets/ThreadableWebSocketChannel.cpp
Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
Modules/websockets/WebSocket.cpp
Modules/websockets/WebSocketChannel.cpp
Modified: trunk/Source/WebCore/ChangeLog (202929 => 202930)
--- trunk/Source/WebCore/ChangeLog 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/ChangeLog 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,3 +1,72 @@
+2016-07-07 Alex Christensen <[email protected]>
+
+ Use SocketProvider to create WebSocketChannels
+ https://bugs.webkit.org/show_bug.cgi?id=158776
+
+ Reviewed by Brent Fulgham.
+
+ This patch should have no change in behavior except making an InvalidStateError in
+ conditions where we should not be able to do networking, like in a detached frame.
+ It just replaces ThreadableWebSocketChannel::create with SocketProvider::createWebSocketChannel
+ which does the same thing as ThreadableWebSocketChannel::create for Mac and
+ Windows WebKit1. The WebKit2 implementation is the same right now, but it will
+ be replaced by a proxy that will do the WebSocket operations in the NetworkProcess.
+
+ * Modules/websockets/ThreadableWebSocketChannel.cpp: Removed.
+ * Modules/websockets/ThreadableWebSocketChannel.h:
+ (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
+ * Modules/websockets/WebSocket.cpp:
+ (WebCore::WebSocket::connect):
+ * Modules/websockets/WebSocketChannel.h:
+ * Modules/websockets/WorkerThreadableWebSocketChannel.h:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::idbConnectionProxy):
+ (WebCore::Document::socketProvider):
+ (WebCore::Document::canNavigate):
+ * dom/Document.h:
+ (WebCore::Document::notifyRemovePendingSheetIfNeeded):
+ * dom/ScriptExecutionContext.h:
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::InspectorOverlay::overlayPage):
+ * loader/EmptyClients.cpp:
+ (WebCore::EmptyEditorClient::registerRedoStep):
+ (WebCore::EmptySocketProvider::createWebSocketChannel):
+ * loader/EmptyClients.h:
+ * page/Page.h:
+ * page/PageConfiguration.cpp:
+ (WebCore::PageConfiguration::PageConfiguration):
+ * page/PageConfiguration.h:
+ * page/SocketProvider.h:
+ (WebCore::SocketProvider::~SocketProvider):
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::dataChanged):
+ * workers/DedicatedWorkerGlobalScope.cpp:
+ (WebCore::DedicatedWorkerGlobalScope::create):
+ (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
+ * workers/DedicatedWorkerGlobalScope.h:
+ * workers/DedicatedWorkerThread.cpp:
+ (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
+ (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
+ (WebCore::DedicatedWorkerThread::runEventLoop):
+ * workers/DedicatedWorkerThread.h:
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::WorkerGlobalScope):
+ (WebCore::WorkerGlobalScope::disableEval):
+ (WebCore::WorkerGlobalScope::socketProvider):
+ (WebCore::WorkerGlobalScope::idbConnectionProxy):
+ * workers/WorkerGlobalScope.h:
+ (WebCore::WorkerGlobalScope::script):
+ * workers/WorkerMessagingProxy.cpp:
+ (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
+ (WebCore::WorkerThread::WorkerThread):
+ (WebCore::WorkerThread::idbConnectionProxy):
+ (WebCore::WorkerThread::socketProvider):
+ * workers/WorkerThread.h:
+ (WebCore::WorkerThread::workerGlobalScope):
+
2016-07-07 Commit Queue <[email protected]>
Unreviewed, rolling out r202905 and r202911.
Deleted: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp (202929 => 202930)
--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2009, 2012 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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"
-
-#if ENABLE(WEB_SOCKETS)
-
-#include "ThreadableWebSocketChannel.h"
-
-#include "Document.h"
-#include "ScriptExecutionContext.h"
-#include "ThreadableWebSocketChannelClientWrapper.h"
-#include "WebSocketChannel.h"
-#include "WebSocketChannelClient.h"
-#include "WorkerGlobalScope.h"
-#include "WorkerRunLoop.h"
-#include "WorkerThread.h"
-#include "WorkerThreadableWebSocketChannel.h"
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-static const char webSocketChannelMode[] = "webSocketChannelMode";
-
-Ref<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(ScriptExecutionContext& context, WebSocketChannelClient& client)
-{
- if (is<WorkerGlobalScope>(context)) {
- WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(context);
- WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop();
- StringBuilder mode;
- mode.appendLiteral(webSocketChannelMode);
- mode.appendNumber(runLoop.createUniqueId());
- return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode.toString());
- }
-
- return WebSocketChannel::create(downcast<Document>(context), client);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_SOCKETS)
Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h (202929 => 202930)
--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -51,7 +51,6 @@
WTF_MAKE_NONCOPYABLE(ThreadableWebSocketChannel);
public:
ThreadableWebSocketChannel() { }
- static Ref<ThreadableWebSocketChannel> create(ScriptExecutionContext&, WebSocketChannelClient&);
enum SendResult {
SendSuccess,
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (202929 => 202930)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -50,6 +50,7 @@
#include "ScriptController.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
+#include "SocketProvider.h"
#include "ThreadableWebSocketChannel.h"
#include "WebSocketChannel.h"
#include <inspector/ScriptCallStack.h>
@@ -250,8 +251,12 @@
return;
}
- m_channel = ThreadableWebSocketChannel::create(*scriptExecutionContext(), *this);
+ if (auto socketProvider = scriptExecutionContext()->socketProvider())
+ m_channel = socketProvider->createWebSocketChannel(*scriptExecutionContext(), *this);
+ // Only an EmptySocketProvider can return nullptr, and every ScriptExecutionContext should have a SocketProvider.
+ RELEASE_ASSERT(m_channel);
+
// FIXME: There is a disagreement about restriction of subprotocols between WebSocket API and hybi-10 protocol
// draft. The former simply says "only characters in the range U+0021 to U+007E are allowed," while the latter
// imposes a stricter rule: "the elements MUST be non-empty strings with characters as defined in [RFC2616],
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h (202929 => 202930)
--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -119,7 +119,7 @@
void derefThreadableWebSocketChannel() override { deref(); }
private:
- WebSocketChannel(Document&, WebSocketChannelClient&);
+ WEBCORE_EXPORT WebSocketChannel(Document&, WebSocketChannelClient&);
bool appendToBuffer(const char* data, size_t len);
void skipBuffer(size_t len);
Modified: trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h (202929 => 202930)
--- trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -160,7 +160,7 @@
Peer* m_peer;
};
- WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient&, const String& taskMode);
+ WEBCORE_EXPORT WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient&, const String& taskMode);
class WorkerGlobalScopeDidInitializeTask;
Modified: trunk/Source/WebCore/PlatformWin.cmake (202929 => 202930)
--- trunk/Source/WebCore/PlatformWin.cmake 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/PlatformWin.cmake 2016-07-07 21:09:14 UTC (rev 202930)
@@ -167,6 +167,7 @@
css
dom
editing
+ fileapi
history
html
inspector
@@ -184,6 +185,7 @@
Modules/geolocation
Modules/indexeddb
+ Modules/websockets
Modules/indexeddb/client
Modules/indexeddb/legacy
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202929 => 202930)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1289,7 +1289,7 @@
2E4346450F546A8200B0F1BA /* Worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346330F546A8200B0F1BA /* Worker.cpp */; };
2E4346460F546A8200B0F1BA /* Worker.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346340F546A8200B0F1BA /* Worker.h */; };
2E4346480F546A8200B0F1BA /* WorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346360F546A8200B0F1BA /* WorkerGlobalScope.cpp */; };
- 2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346370F546A8200B0F1BA /* WorkerGlobalScope.h */; };
+ 2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346370F546A8200B0F1BA /* WorkerGlobalScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
2E43464B0F546A8200B0F1BA /* WorkerGlobalScopeProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346390F546A8200B0F1BA /* WorkerGlobalScopeProxy.h */; };
2E43464C0F546A8200B0F1BA /* WorkerLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E43463A0F546A8200B0F1BA /* WorkerLocation.cpp */; };
2E43464D0F546A8200B0F1BA /* WorkerLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E43463B0F546A8200B0F1BA /* WorkerLocation.h */; };
@@ -1303,7 +1303,7 @@
2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */; };
2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */; };
2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841B12779ADA0062628B /* FileReaderLoader.h */; };
- 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; };
+ 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; };
2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; };
2E9B5D8F1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E9B5D8E1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1933,7 +1933,7 @@
4A0FFAA51AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0FFAA31AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp */; };
4A0FFAA61AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0FFAA41AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */; };
- 4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; };
+ 4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; settings = {ATTRIBUTES = (Private, ); }; };
4A4F48A916B0DFC000EDBB29 /* DocumentRuleSets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */; };
4A4F48AA16B0DFC000EDBB29 /* DocumentRuleSets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */; };
4A4F65701AA997F100E38CDD /* RealtimeMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A4F656B1AA997F100E38CDD /* RealtimeMediaSource.cpp */; };
@@ -2009,7 +2009,7 @@
510D4A34103165EE0049EA54 /* SocketStreamErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A2E103165EE0049EA54 /* SocketStreamErrorBase.h */; };
510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A30103165EE0049EA54 /* SocketStreamHandleBase.cpp */; };
510D4A37103165EE0049EA54 /* SocketStreamHandleBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A31103165EE0049EA54 /* SocketStreamHandleBase.h */; };
- 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; };
+ 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
511EC1271C50AACA0032F983 /* IDBSerialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1251C50AA570032F983 /* IDBSerialization.cpp */; };
511EC1281C50AACA0032F983 /* IDBSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC1261C50AA570032F983 /* IDBSerialization.h */; };
511EC12B1C50ABBF0032F983 /* SQLiteIDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1291C50ABBA0032F983 /* SQLiteIDBTransaction.cpp */; };
@@ -3958,25 +3958,24 @@
97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AA3CA3145237CC003E1DA6 /* EventTargetHeaders.h */; };
97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AA3CA4145237CC003E1DA6 /* EventTargetInterfaces.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCF814FA09D5007457AE /* CloseEvent.h */; };
- 97AABD1614FA09D5007457AE /* ThreadableWebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */; };
- 97AABD1714FA09D5007457AE /* ThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */; };
+ 97AABD1714FA09D5007457AE /* ThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD1814FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */; };
- 97AABD1914FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */; };
+ 97AABD1914FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD1A14FA09D5007457AE /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFF14FA09D5007457AE /* WebSocket.cpp */; };
97AABD1B14FA09D5007457AE /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0014FA09D5007457AE /* WebSocket.h */; };
97AABD1D14FA09D5007457AE /* WebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0214FA09D5007457AE /* WebSocketChannel.cpp */; };
- 97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0314FA09D5007457AE /* WebSocketChannel.h */; };
- 97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0414FA09D5007457AE /* WebSocketChannelClient.h */; };
+ 97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0314FA09D5007457AE /* WebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0414FA09D5007457AE /* WebSocketChannelClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD2014FA09D5007457AE /* WebSocketDeflater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0514FA09D5007457AE /* WebSocketDeflater.cpp */; };
- 97AABD2114FA09D5007457AE /* WebSocketDeflater.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0614FA09D5007457AE /* WebSocketDeflater.h */; };
+ 97AABD2114FA09D5007457AE /* WebSocketDeflater.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0614FA09D5007457AE /* WebSocketDeflater.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD2214FA09D5007457AE /* WebSocketExtensionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0714FA09D5007457AE /* WebSocketExtensionDispatcher.cpp */; };
97AABD2314FA09D5007457AE /* WebSocketExtensionDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0814FA09D5007457AE /* WebSocketExtensionDispatcher.h */; };
- 97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0914FA09D5007457AE /* WebSocketExtensionProcessor.h */; };
- 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0A14FA09D5007457AE /* WebSocketFrame.h */; };
+ 97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0914FA09D5007457AE /* WebSocketExtensionProcessor.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0A14FA09D5007457AE /* WebSocketFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
97AABD2614FA09D5007457AE /* WebSocketHandshake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0B14FA09D5007457AE /* WebSocketHandshake.cpp */; };
97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */; };
97AABD2C14FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD1114FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp */; };
- 97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */; };
+ 97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37569E0013AF172C00CDBA8E /* SharedBufferChunkReader.cpp */; };
97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 37569E0213AF172C00CDBA8E /* SharedBufferChunkReader.h */; };
97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B38E24151C4264004622E9 /* DOMWindowNotifications.h */; };
@@ -4222,7 +4221,7 @@
A3BB59F31457A40D00AC56FE /* DocumentEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3BB59F11457A40D00AC56FE /* DocumentEventQueue.cpp */; };
A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E2642E14748991005A8588 /* WorkerEventQueue.cpp */; };
- A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3E2642F14748991005A8588 /* WorkerEventQueue.h */; };
+ A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3E2642F14748991005A8588 /* WorkerEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */; };
A4226E5A1163D667008B8397 /* JSHTMLProgressElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */; };
A4226E5C1163D695008B8397 /* JSHTMLProgressElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A4226E5B1163D695008B8397 /* JSHTMLProgressElement.h */; };
@@ -6552,7 +6551,7 @@
E1A3162D134BC32D007C9A4F /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1A3162E134BC32D007C9A4F /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */; };
E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */; };
- E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; };
+ E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1A643FD0EC097A000779668 /* WorkerScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */; };
E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */; };
E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A8E56517552B2A007488E7 /* CFURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11705,7 +11704,6 @@
97AA3CA4145237CC003E1DA6 /* EventTargetInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTargetInterfaces.h; sourceTree = "<group>"; };
97AABCF814FA09D5007457AE /* CloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloseEvent.h; sourceTree = "<group>"; };
97AABCF914FA09D5007457AE /* CloseEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CloseEvent.idl; sourceTree = "<group>"; };
- 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannel.cpp; sourceTree = "<group>"; };
97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableWebSocketChannel.h; sourceTree = "<group>"; };
97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannelClientWrapper.cpp; sourceTree = "<group>"; };
97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableWebSocketChannelClientWrapper.h; sourceTree = "<group>"; };
@@ -19933,7 +19931,6 @@
children = (
97AABCF814FA09D5007457AE /* CloseEvent.h */,
97AABCF914FA09D5007457AE /* CloseEvent.idl */,
- 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */,
97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */,
97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */,
97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */,
@@ -32237,7 +32234,6 @@
BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */,
976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
- 97AABD1614FA09D5007457AE /* ThreadableWebSocketChannel.cpp in Sources */,
97AABD1814FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp in Sources */,
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
0F6383DD18615B29003E5DB5 /* ThreadedScrollingTree.cpp in Sources */,
Modified: trunk/Source/WebCore/dom/Document.cpp (202929 => 202930)
--- trunk/Source/WebCore/dom/Document.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -162,6 +162,7 @@
#include "SelectorQuery.h"
#include "Settings.h"
#include "ShadowRoot.h"
+#include "SocketProvider.h"
#include "StorageEvent.h"
#include "StyleProperties.h"
#include "StyleResolveForDocument.h"
@@ -541,6 +542,9 @@
, m_disabledFieldsetElementsCount(0)
, m_hasInjectedPlugInsScript(false)
, m_hasStyleWithViewportUnits(false)
+#if ENABLE(WEB_SOCKETS)
+ , m_socketProvider(page() ? &page()->socketProvider() : nullptr)
+#endif
{
allDocuments().add(this);
@@ -3087,6 +3091,13 @@
}
#endif // ENABLE(INDEXED_DATABASE)
+#if ENABLE(WEB_SOCKETS)
+SocketProvider* Document::socketProvider()
+{
+ return m_socketProvider.get();
+}
+#endif
+
bool Document::canNavigate(Frame* targetFrame)
{
if (!m_frame)
Modified: trunk/Source/WebCore/dom/Document.h (202929 => 202930)
--- trunk/Source/WebCore/dom/Document.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/dom/Document.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -665,6 +665,9 @@
#if ENABLE(INDEXED_DATABASE)
IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
#endif
+#if ENABLE(WEB_SOCKETS)
+ SocketProvider* socketProvider() final;
+#endif
bool canNavigate(Frame* targetFrame);
Frame* findUnsafeParentScrollPropagationBoundary();
@@ -1794,6 +1797,9 @@
#if ENABLE(INDEXED_DATABASE)
RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
#endif
+#if ENABLE(WEB_SOCKETS)
+ RefPtr<SocketProvider> m_socketProvider;
+#endif
};
inline void Document::notifyRemovePendingSheetIfNeeded()
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (202929 => 202930)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -60,6 +60,7 @@
class PublicURLManager;
class ResourceRequest;
class SecurityOrigin;
+class SocketProvider;
class URL;
namespace IDBClient {
@@ -87,6 +88,9 @@
#if ENABLE(INDEXED_DATABASE)
virtual IDBClient::IDBConnectionProxy* idbConnectionProxy() = 0;
#endif
+#if ENABLE(WEB_SOCKETS)
+ virtual SocketProvider* socketProvider() = 0;
+#endif
bool sanitizeScriptError(String& errorMessage, int& lineNumber, int& columnNumber, String& sourceURL, Deprecated::ScriptValue& error, CachedScript* = nullptr);
void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, JSC::Exception*, RefPtr<Inspector::ScriptCallStack>&&, CachedScript* = nullptr);
Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (202929 => 202930)
--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -864,7 +864,7 @@
if (m_overlayPage)
return m_overlayPage.get();
- PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), makeUniqueRef<EmptySocketProvider>());
+ PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), EmptySocketProvider::create());
fillWithEmptyClients(pageConfiguration);
m_overlayPage = std::make_unique<Page>(WTFMove(pageConfiguration));
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (202929 => 202930)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -45,6 +45,7 @@
#include "StorageArea.h"
#include "StorageNamespace.h"
#include "StorageNamespaceProvider.h"
+#include "ThreadableWebSocketChannel.h"
#include "UserContentProvider.h"
#include <wtf/NeverDestroyed.h>
@@ -263,5 +264,10 @@
void EmptyEditorClient::registerRedoStep(PassRefPtr<UndoStep>)
{
}
+
+RefPtr<ThreadableWebSocketChannel> EmptySocketProvider::createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&)
+{
+ return nullptr;
+}
}
Modified: trunk/Source/WebCore/loader/EmptyClients.h (202929 => 202930)
--- trunk/Source/WebCore/loader/EmptyClients.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -644,8 +644,12 @@
};
class EmptySocketProvider final : public SocketProvider {
+public:
+ virtual ~EmptySocketProvider() { }
+ static Ref<EmptySocketProvider> create() { return adoptRef(*new EmptySocketProvider); }
+ RefPtr<ThreadableWebSocketChannel> createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&) override;
};
-
+
void fillWithEmptyClients(PageConfiguration&);
}
Modified: trunk/Source/WebCore/page/Page.h (202929 => 202930)
--- trunk/Source/WebCore/page/Page.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/page/Page.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -696,7 +696,7 @@
unsigned m_lastSpatialNavigationCandidatesCount;
unsigned m_forbidPromptsDepth;
- UniqueRef<SocketProvider> m_socketProvider;
+ Ref<SocketProvider> m_socketProvider;
Ref<ApplicationCacheStorage> m_applicationCacheStorage;
Ref<DatabaseProvider> m_databaseProvider;
Ref<StorageNamespaceProvider> m_storageNamespaceProvider;
Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (202929 => 202930)
--- trunk/Source/WebCore/page/PageConfiguration.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -38,7 +38,7 @@
namespace WebCore {
-PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, UniqueRef<SocketProvider>&& socketProvider)
+PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider)
: editorClient(WTFMove(editorClient))
, socketProvider(WTFMove(socketProvider))
{
Modified: trunk/Source/WebCore/page/PageConfiguration.h (202929 => 202930)
--- trunk/Source/WebCore/page/PageConfiguration.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/page/PageConfiguration.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -57,7 +57,7 @@
class PageConfiguration {
WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
public:
- WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, UniqueRef<SocketProvider>&&);
+ WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&);
WEBCORE_EXPORT ~PageConfiguration();
AlternativeTextClient* alternativeTextClient { nullptr };
@@ -66,7 +66,7 @@
ContextMenuClient* contextMenuClient { nullptr };
#endif
UniqueRef<EditorClient> editorClient;
- UniqueRef<SocketProvider> socketProvider;
+ Ref<SocketProvider> socketProvider;
DragClient* dragClient { nullptr };
InspectorClient* inspectorClient { nullptr };
#if ENABLE(APPLE_PAY)
Modified: trunk/Source/WebCore/page/SocketProvider.h (202929 => 202930)
--- trunk/Source/WebCore/page/SocketProvider.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/page/SocketProvider.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -25,10 +25,18 @@
#pragma once
+#include <wtf/RefPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
namespace WebCore {
-class SocketProvider {
+class ScriptExecutionContext;
+class ThreadableWebSocketChannel;
+class WebSocketChannelClient;
+
+class SocketProvider : public ThreadSafeRefCounted<SocketProvider> {
public:
+ virtual RefPtr<ThreadableWebSocketChannel> createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&) = 0;
virtual ~SocketProvider() { };
};
Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (202929 => 202930)
--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -380,7 +380,7 @@
return true;
if (allDataReceived) {
- PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), makeUniqueRef<EmptySocketProvider>());
+ PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), EmptySocketProvider::create());
fillWithEmptyClients(pageConfiguration);
m_chromeClient = std::make_unique<SVGImageChromeClient>(this);
pageConfiguration.chromeClient = m_chromeClient.get();
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (202929 => 202930)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -41,16 +41,16 @@
namespace WebCore {
-Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
+Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
{
- Ref<DedicatedWorkerGlobalScope> context = adoptRef(*new DedicatedWorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy));
+ Ref<DedicatedWorkerGlobalScope> context = adoptRef(*new DedicatedWorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider));
if (!shouldBypassMainWorldContentSecurityPolicy)
context->applyContentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders);
return context;
}
-DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
- : WorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy)
+DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
+ : WorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider)
{
}
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h (202929 => 202930)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -42,7 +42,7 @@
class DedicatedWorkerGlobalScope : public WorkerGlobalScope {
public:
typedef WorkerGlobalScope Base;
- static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
+ static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
virtual ~DedicatedWorkerGlobalScope();
bool isDedicatedWorkerGlobalScope() const override { return true; }
@@ -60,7 +60,7 @@
DedicatedWorkerThread& thread();
private:
- DedicatedWorkerGlobalScope(const URL&, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
+ DedicatedWorkerGlobalScope(const URL&, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
};
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp (202929 => 202930)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -38,8 +38,8 @@
namespace WebCore {
-DedicatedWorkerThread::DedicatedWorkerThread(const URL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
- : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy)
+DedicatedWorkerThread::DedicatedWorkerThread(const URL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
+ : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider)
, m_workerObjectProxy(workerObjectProxy)
{
}
@@ -50,7 +50,7 @@
Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin)
{
- return DedicatedWorkerGlobalScope::create(url, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, idbConnectionProxy());
+ return DedicatedWorkerGlobalScope::create(url, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, idbConnectionProxy(), socketProvider());
}
void DedicatedWorkerThread::runEventLoop()
Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (202929 => 202930)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -53,7 +53,7 @@
void runEventLoop() override;
private:
- DedicatedWorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*);
+ DedicatedWorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
WorkerObjectProxy& m_workerObjectProxy;
};
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (202929 => 202930)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -43,6 +43,7 @@
#include "ScriptSourceCode.h"
#include "SecurityOrigin.h"
#include "SecurityOriginPolicy.h"
+#include "SocketProvider.h"
#include "URL.h"
#include "WorkerLocation.h"
#include "WorkerNavigator.h"
@@ -63,7 +64,7 @@
namespace WebCore {
-WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
+WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
: m_url(url)
, m_userAgent(userAgent)
, m_script(std::make_unique<WorkerScriptController>(this))
@@ -75,6 +76,9 @@
#if ENABLE(INDEXED_DATABASE)
, m_connectionProxy(connectionProxy)
#endif
+#if ENABLE(WEB_SOCKETS)
+ , m_socketProvider(socketProvider)
+#endif
{
#if !ENABLE(INDEXED_DATABASE)
UNUSED_PARAM(connectionProxy);
@@ -123,6 +127,13 @@
m_script->disableEval(errorMessage);
}
+#if ENABLE(WEB_SOCKETS)
+SocketProvider* WorkerGlobalScope::socketProvider()
+{
+ return m_socketProvider.get();
+}
+#endif
+
#if ENABLE(INDEXED_DATABASE)
IDBClient::IDBConnectionProxy* WorkerGlobalScope::idbConnectionProxy()
{
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (202929 => 202930)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -36,7 +36,6 @@
#include <memory>
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/TypeCasts.h>
@@ -81,6 +80,10 @@
void stopIndexedDatabase();
#endif
+#if ENABLE(WEB_SOCKETS)
+ SocketProvider* socketProvider() final;
+#endif
+
bool shouldBypassMainWorldContentSecurityPolicy() const final { return m_shouldBypassMainWorldContentSecurityPolicy; }
WorkerScriptController* script() { return m_script.get(); }
@@ -147,7 +150,7 @@
#endif
protected:
- WorkerGlobalScope(const URL&, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
+ WorkerGlobalScope(const URL&, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
void applyContentSecurityPolicyResponseHeaders(const ContentSecurityPolicyResponseHeaders&);
void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) override;
@@ -188,6 +191,9 @@
#if ENABLE(INDEXED_DATABASE)
RefPtr<IDBClient::IDBConnectionProxy> m_connectionProxy;
#endif
+#if ENABLE(WEB_SOCKETS)
+ RefPtr<SocketProvider> m_socketProvider;
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (202929 => 202930)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -79,11 +79,19 @@
Document& document = downcast<Document>(*m_scriptExecutionContext);
#if ENABLE(INDEXED_DATABASE)
- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), document.idbConnectionProxy());
+ IDBClient::IDBConnectionProxy* proxy = document.idbConnectionProxy();
#else
- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), nullptr);
+ IDBClient::IDBConnectionProxy* proxy = nullptr;
#endif
+#if ENABLE(WEB_SOCKETS)
+ SocketProvider* socketProvider = document.socketProvider();
+#else
+ SocketProvider* socketProvider = nullptr;
+#endif
+
+ RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), proxy, socketProvider);
+
workerThreadCreated(thread);
thread->start();
}
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (202929 => 202930)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -33,6 +33,7 @@
#include "IDBConnectionProxy.h"
#include "ScriptSourceCode.h"
#include "SecurityOrigin.h"
+#include "SocketProvider.h"
#include "ThreadGlobalData.h"
#include "URL.h"
#include <utility>
@@ -93,7 +94,7 @@
{
}
-WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
+WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
: m_threadID(0)
, m_workerLoaderProxy(workerLoaderProxy)
, m_workerReportingProxy(workerReportingProxy)
@@ -104,6 +105,9 @@
#if ENABLE(INDEXED_DATABASE)
, m_idbConnectionProxy(connectionProxy)
#endif
+#if ENABLE(WEB_SOCKETS)
+ , m_socketProvider(socketProvider)
+#endif
{
#if !ENABLE(INDEXED_DATABASE)
UNUSED_PARAM(connectionProxy);
@@ -253,4 +257,13 @@
#endif
}
+SocketProvider* WorkerThread::socketProvider()
+{
+#if ENABLE(WEB_SOCKETS)
+ return m_socketProvider.get();
+#else
+ return nullptr;
+#endif
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/WorkerThread.h (202929 => 202930)
--- trunk/Source/WebCore/workers/WorkerThread.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -38,6 +38,7 @@
class URL;
class NotificationClient;
class SecurityOrigin;
+class SocketProvider;
class WorkerGlobalScope;
class WorkerLoaderProxy;
class WorkerReportingProxy;
@@ -72,7 +73,7 @@
#endif
protected:
- WorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*);
+ WorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
// Factory method for creating a new worker context for the thread.
virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin) = 0;
@@ -83,6 +84,7 @@
WorkerGlobalScope* workerGlobalScope() { return m_workerGlobalScope.get(); }
IDBClient::IDBConnectionProxy* idbConnectionProxy();
+ SocketProvider* socketProvider();
private:
// Static function executed as the core routine on the new thread. Passed a pointer to a WorkerThread object.
@@ -106,6 +108,9 @@
#if ENABLE(INDEXED_DATABASE)
RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
#endif
+#if ENABLE(WEB_SOCKETS)
+ RefPtr<SocketProvider> m_socketProvider;
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (202929 => 202930)
--- trunk/Source/WebKit/ChangeLog 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/ChangeLog 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,3 +1,14 @@
+2016-07-07 Alex Christensen <[email protected]>
+
+ Use SocketProvider to create WebSocketChannels
+ https://bugs.webkit.org/show_bug.cgi?id=158776
+
+ Reviewed by Brent Fulgham.
+
+ * PlatformMac.cmake:
+ * PlatformWin.cmake:
+ * WebKit.xcodeproj/project.pbxproj:
+
2016-07-03 Per Arne Vollan <[email protected]>
[Win] DLLs are missing version information.
Modified: trunk/Source/WebKit/PlatformMac.cmake (202929 => 202930)
--- trunk/Source/WebKit/PlatformMac.cmake 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/PlatformMac.cmake 2016-07-07 21:09:14 UTC (rev 202930)
@@ -114,6 +114,7 @@
mac/Misc/WebNSViewExtras.m
mac/Misc/WebNSWindowExtras.m
mac/Misc/WebSharingServicePickerController.mm
+ mac/Misc/WebSocketProvider.mm
mac/Misc/WebStringTruncator.mm
mac/Misc/WebUserContentURLPattern.mm
Modified: trunk/Source/WebKit/PlatformWin.cmake (202929 => 202930)
--- trunk/Source/WebKit/PlatformWin.cmake 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/PlatformWin.cmake 2016-07-07 21:09:14 UTC (rev 202930)
@@ -195,6 +195,7 @@
win/WebScriptWorld.cpp
win/WebSecurityOrigin.cpp
win/WebSerializedJSValue.cpp
+ win/WebSocketProvider.cpp
win/WebTextRenderer.cpp
win/WebURLAuthenticationChallenge.cpp
win/WebURLAuthenticationChallengeSender.cpp
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (202929 => 202930)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2016-07-07 21:09:14 UTC (rev 202930)
@@ -147,6 +147,8 @@
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, ); }; };
+ 5C7706701D111B020012700F /* WebSocketProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C77066F1D111B020012700F /* WebSocketProvider.mm */; };
+ 5C7706721D111B220012700F /* QuickDrawCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7706711D111B220012700F /* QuickDrawCompatibility.h */; };
5C7C88DA1D0F3BF2009D2F6D /* WebSocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.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 */; };
@@ -649,6 +651,8 @@
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>"; };
+ 5C77066F1D111B020012700F /* WebSocketProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSocketProvider.mm; sourceTree = "<group>"; };
+ 5C7706711D111B220012700F /* QuickDrawCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickDrawCompatibility.h; sourceTree = "<group>"; };
5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketProvider.h; sourceTree = "<group>"; };
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>"; };
@@ -1093,6 +1097,8 @@
254DC334016E1D3F0ECA149E /* Misc */ = {
isa = PBXGroup;
children = (
+ 5C7706711D111B220012700F /* QuickDrawCompatibility.h */,
+ 5C77066F1D111B020012700F /* WebSocketProvider.mm */,
5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.h */,
A10C1D2018202FAF0036883A /* ios */,
1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */,
@@ -1958,6 +1964,7 @@
939810150824BF01008DF038 /* WebURLsWithTitles.h in Headers */,
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
070F549B17F1E42B00169E04 /* WebUserMediaClient.h in Headers */,
+ 5C7706721D111B220012700F /* QuickDrawCompatibility.h in Headers */,
939810700824BF01008DF038 /* WebView.h in Headers */,
BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */,
1430C12D1B2C5DF700DEA01D /* WebViewGroup.h in Headers */,
@@ -2271,6 +2278,7 @@
1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */,
BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */,
+ 5C7706701D111B020012700F /* WebSocketProvider.mm in Sources */,
072E5F461ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm in Sources */,
A10C1D731820300E0036883A /* WebMIMETypeRegistry.mm in Sources */,
5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */,
Modified: trunk/Source/WebKit/mac/ChangeLog (202929 => 202930)
--- trunk/Source/WebKit/mac/ChangeLog 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,3 +1,18 @@
+2016-07-07 Alex Christensen <[email protected]>
+
+ Use SocketProvider to create WebSocketChannels
+ https://bugs.webkit.org/show_bug.cgi?id=158776
+
+ Reviewed by Brent Fulgham.
+
+ * Misc/WebSocketProvider.mm: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
+ (WebSocketProvider::createWebSocketChannel):
+ (WebCore::ThreadableWebSocketChannel::create): Deleted.
+ * Misc/WebSocketProvider.h:
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
2016-07-06 Benjamin Poulain <[email protected]>
[JSC] Unify how we throw TypeError from C++
Modified: trunk/Source/WebKit/mac/Misc/WebSocketProvider.h (202929 => 202930)
--- trunk/Source/WebKit/mac/Misc/WebSocketProvider.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/mac/Misc/WebSocketProvider.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -25,7 +25,11 @@
#pragma once
-#include <WebCore/SocketProvider.h>
+#import <WebCore/SocketProvider.h>
class WebSocketProvider final : public WebCore::SocketProvider {
+public:
+ static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
+ RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
+ virtual ~WebSocketProvider() { }
};
Copied: trunk/Source/WebKit/mac/Misc/WebSocketProvider.mm (from rev 202929, trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp) (0 => 202930)
--- trunk/Source/WebKit/mac/Misc/WebSocketProvider.mm (rev 0)
+++ trunk/Source/WebKit/mac/Misc/WebSocketProvider.mm 2016-07-07 21:09:14 UTC (rev 202930)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2009, 2012 Google 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:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "WebSocketProvider.h"
+
+#if ENABLE(WEB_SOCKETS)
+
+#import <WebCore/Document.h>
+#import <WebCore/ScriptExecutionContext.h>
+#import <WebCore/ThreadableWebSocketChannelClientWrapper.h>
+#import <WebCore/WebSocketChannel.h>
+#import <WebCore/WebSocketChannelClient.h>
+#import <WebCore/WorkerGlobalScope.h>
+#import <WebCore/WorkerRunLoop.h>
+#import <WebCore/WorkerThread.h>
+#import <WebCore/WorkerThreadableWebSocketChannel.h>
+#import <wtf/text/StringBuilder.h>
+
+using namespace WebCore;
+
+static const char webSocketChannelMode[] = "webSocketChannelMode";
+
+RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
+{
+ if (is<WorkerGlobalScope>(context)) {
+ WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(context);
+ WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop();
+ StringBuilder mode;
+ mode.appendLiteral(webSocketChannelMode);
+ mode.appendNumber(runLoop.createUniqueId());
+ return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode.toString());
+ }
+
+ return WebSocketChannel::create(downcast<Document>(context), client);
+}
+
+#endif // ENABLE(WEB_SOCKETS)
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (202929 => 202930)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-07-07 21:09:14 UTC (rev 202930)
@@ -996,7 +996,7 @@
_private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
_private->group->addWebView(self);
- PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), makeUniqueRef<WebSocketProvider>());
+ PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), WebSocketProvider::create());
#if !PLATFORM(IOS)
pageConfiguration.chromeClient = new WebChromeClient(self);
pageConfiguration.contextMenuClient = new WebContextMenuClient(self);
@@ -1246,7 +1246,7 @@
_private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
_private->group->addWebView(self);
- PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), makeUniqueRef<WebSocketProvider>());
+ PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), WebSocketProvider::create());
pageConfiguration.chromeClient = new WebChromeClientIOS(self);
#if ENABLE(DRAG_SUPPORT)
pageConfiguration.dragClient = new WebDragClient(self);
Modified: trunk/Source/WebKit/win/ChangeLog (202929 => 202930)
--- trunk/Source/WebKit/win/ChangeLog 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/win/ChangeLog 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,3 +1,15 @@
+2016-07-07 Alex Christensen <[email protected]>
+
+ Use SocketProvider to create WebSocketChannels
+ https://bugs.webkit.org/show_bug.cgi?id=158776
+
+ Reviewed by Brent Fulgham.
+
+ * WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
+ (WebSocketProvider::createWebSocketChannel):
+ (WebCore::ThreadableWebSocketChannel::create): Deleted.
+ * WebSocketProvider.h:
+
2016-07-06 Per Arne Vollan <[email protected]>
[Win] Add null pointer check in gesture handling.
Copied: trunk/Source/WebKit/win/WebSocketProvider.cpp (from rev 202929, trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp) (0 => 202930)
--- trunk/Source/WebKit/win/WebSocketProvider.cpp (rev 0)
+++ trunk/Source/WebKit/win/WebSocketProvider.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2009, 2012 Google 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:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "WebSocketProvider.h"
+
+#if ENABLE(WEB_SOCKETS)
+
+#include <WebCore/Document.h>
+#include <WebCore/ScriptExecutionContext.h>
+#include <WebCore/ThreadableWebSocketChannelClientWrapper.h>
+#include <WebCore/WebSocketChannel.h>
+#include <WebCore/WebSocketChannelClient.h>
+#include <WebCore/WorkerGlobalScope.h>
+#include <WebCore/WorkerRunLoop.h>
+#include <WebCore/WorkerThread.h>
+#include <WebCore/WorkerThreadableWebSocketChannel.h>
+#include <wtf/text/StringBuilder.h>
+
+using namespace WebCore;
+
+static const char webSocketChannelMode[] = "webSocketChannelMode";
+
+RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
+{
+ if (is<WorkerGlobalScope>(context)) {
+ WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(context);
+ WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop();
+ StringBuilder mode;
+ mode.appendLiteral(webSocketChannelMode);
+ mode.appendNumber(runLoop.createUniqueId());
+ return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode.toString());
+ }
+
+ return WebSocketChannel::create(downcast<Document>(context), client);
+}
+
+#endif // ENABLE(WEB_SOCKETS)
Modified: trunk/Source/WebKit/win/WebSocketProvider.h (202929 => 202930)
--- trunk/Source/WebKit/win/WebSocketProvider.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit/win/WebSocketProvider.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -28,4 +28,8 @@
#include <WebCore/SocketProvider.h>
class WebSocketProvider final : public WebCore::SocketProvider {
+public:
+ static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
+ RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
+ virtual ~WebSocketProvider() { }
};
Modified: trunk/Source/WebKit2/CMakeLists.txt (202929 => 202930)
--- trunk/Source/WebKit2/CMakeLists.txt 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit2/CMakeLists.txt 2016-07-07 21:09:14 UTC (rev 202930)
@@ -133,6 +133,7 @@
"${WEBCORE_DIR}/svg"
"${WEBCORE_DIR}/svg/graphics"
"${WEBCORE_DIR}/svg/properties"
+ "${WEBCORE_DIR}/workers"
"${_javascript_CORE_DIR}"
"${_javascript_CORE_DIR}/ForwardingHeaders"
"${_javascript_CORE_DIR}/API"
@@ -573,6 +574,7 @@
WebProcess/Network/NetworkProcessConnection.cpp
WebProcess/Network/WebLoaderStrategy.cpp
WebProcess/Network/WebResourceLoader.cpp
+ WebProcess/Network/WebSocketProvider.cpp
WebProcess/Notifications/NotificationPermissionRequestManager.cpp
WebProcess/Notifications/WebNotificationManager.cpp
Modified: trunk/Source/WebKit2/ChangeLog (202929 => 202930)
--- trunk/Source/WebKit2/ChangeLog 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1,3 +1,19 @@
+2016-07-07 Alex Christensen <[email protected]>
+
+ Use SocketProvider to create WebSocketChannels
+ https://bugs.webkit.org/show_bug.cgi?id=158776
+
+ Reviewed by Brent Fulgham.
+
+ * CMakeLists.txt:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
+ (WebKit::WebSocketProvider::createWebSocketChannel):
+ (WebCore::ThreadableWebSocketChannel::create): Deleted.
+ * WebProcess/Network/WebSocketProvider.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_shouldDispatchFakeMouseMoveEvents):
+
2016-07-07 Antoine Quint <[email protected]>
<img> with a wide gamut PDF does not display using a wide gamut color space
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (202929 => 202930)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2016-07-07 21:09:14 UTC (rev 202930)
@@ -1045,6 +1045,7 @@
5C20CB9D1BB0DCFA00895BB1 /* NetworkSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C20CB9B1BB0DCD200895BB1 /* NetworkSessionCocoa.mm */; };
5C20CBA01BB1ECD800895BB1 /* NetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */; };
5C298DA01C3DF02100470AFE /* PendingDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */; };
+ 5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */; };
5C85C7881C3F23CE0061A4FA /* PendingDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */; };
5CBC9B8D1C65279C00A8FDCF /* NetworkDataTaskCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC9B8B1C65257300A8FDCF /* NetworkDataTaskCocoa.mm */; };
5CBC9B8E1C652CA000A8FDCF /* NetworkDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */; };
@@ -3093,6 +3094,7 @@
5C20CB9B1BB0DCD200895BB1 /* NetworkSessionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkSessionCocoa.mm; path = NetworkProcess/cocoa/NetworkSessionCocoa.mm; sourceTree = "<group>"; };
5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkSession.h; path = NetworkProcess/NetworkSession.h; sourceTree = "<group>"; };
5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDownload.h; path = NetworkProcess/Downloads/PendingDownload.h; sourceTree = "<group>"; };
+ 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketProvider.cpp; path = Network/WebSocketProvider.cpp; sourceTree = "<group>"; };
5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketProvider.h; path = Network/WebSocketProvider.h; sourceTree = "<group>"; };
5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PendingDownload.cpp; path = NetworkProcess/Downloads/PendingDownload.cpp; sourceTree = "<group>"; };
5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkDataTask.h; path = NetworkProcess/NetworkDataTask.h; sourceTree = "<group>"; };
@@ -5333,6 +5335,7 @@
5105B0D2162F7A5E00E27709 /* Network */ = {
isa = PBXGroup;
children = (
+ 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */,
5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */,
5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */,
5105B0D5162F7A7A00E27709 /* NetworkProcessConnection.h */,
@@ -9259,6 +9262,7 @@
1AA83F6C1A5B63FF00026EC6 /* WebDatabaseProvider.cpp in Sources */,
CD19A26D1A13E82A008D650E /* WebDiagnosticLoggingClient.cpp in Sources */,
1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */,
+ 5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */,
BC111A5D112F4FBB00337BAB /* WebDragClient.cpp in Sources */,
C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */,
BCA0EFA012332642007D3CFB /* WebEditCommandProxy.cpp in Sources */,
Copied: trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.cpp (from rev 202929, trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp) (0 => 202930)
--- trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.cpp (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2009, 2012 Google 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:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "WebSocketProvider.h"
+
+#if ENABLE(WEB_SOCKETS)
+
+#include <WebCore/Document.h>
+#include <WebCore/ScriptExecutionContext.h>
+#include <WebCore/ThreadableWebSocketChannelClientWrapper.h>
+#include <WebCore/WebSocketChannel.h>
+#include <WebCore/WebSocketChannelClient.h>
+#include <WebCore/WorkerGlobalScope.h>
+#include <WebCore/WorkerRunLoop.h>
+#include <WebCore/WorkerThread.h>
+#include <WebCore/WorkerThreadableWebSocketChannel.h>
+#include <wtf/text/StringBuilder.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static const char webSocketChannelMode[] = "webSocketChannelMode";
+
+RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
+{
+ // FIXME: This should return a proxy so we can do the actual network interactions in the NetworkProcess.
+ if (is<WorkerGlobalScope>(context)) {
+ WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(context);
+ WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop();
+ StringBuilder mode;
+ mode.appendLiteral(webSocketChannelMode);
+ mode.appendNumber(runLoop.createUniqueId());
+ return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode.toString());
+ }
+
+ return WebSocketChannel::create(downcast<Document>(context), client);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(WEB_SOCKETS)
Modified: trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.h (202929 => 202930)
--- trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.h 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.h 2016-07-07 21:09:14 UTC (rev 202930)
@@ -30,6 +30,10 @@
namespace WebKit {
class WebSocketProvider final : public WebCore::SocketProvider {
+public:
+ static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
+ RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
+ virtual ~WebSocketProvider() { }
};
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (202929 => 202930)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-07-07 20:53:41 UTC (rev 202929)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-07-07 21:09:14 UTC (rev 202930)
@@ -388,7 +388,7 @@
Settings::setShouldManageAudioSessionCategory(true);
#endif
- PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(this), makeUniqueRef<WebSocketProvider>());
+ PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(this), WebSocketProvider::create());
pageConfiguration.chromeClient = new WebChromeClient(this);
#if ENABLE(CONTEXT_MENUS)
pageConfiguration.contextMenuClient = new WebContextMenuClient(this);