⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 202930 in webkit


Ignore:
Timestamp:
Jul 7, 2016, 2:09:14 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Use SocketProvider to create WebSocketChannels
https://bugs.webkit.org/show_bug.cgi?id=158776

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-07
Reviewed by Brent Fulgham.

Source/WebCore:

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):

Source/WebKit:

  • PlatformMac.cmake:
  • PlatformWin.cmake:
  • WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

  • 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:]):

Source/WebKit/win:

  • WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.

(WebSocketProvider::createWebSocketChannel):
(WebCore::ThreadableWebSocketChannel::create): Deleted.

  • WebSocketProvider.h:

Source/WebKit2:

  • 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):

Location:
trunk/Source
Files:
42 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r202873 r202930  
    10351035    Modules/webdatabase/SQLTransactionStateMachine.cpp
    10361036
    1037     Modules/websockets/ThreadableWebSocketChannel.cpp
    10381037    Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
    10391038    Modules/websockets/WebSocket.cpp
  • trunk/Source/WebCore/ChangeLog

    r202929 r202930  
     12016-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use SocketProvider to create WebSocketChannels
     4        https://bugs.webkit.org/show_bug.cgi?id=158776
     5
     6        Reviewed by Brent Fulgham.
     7
     8        This patch should have no change in behavior except making an InvalidStateError in
     9        conditions where we should not be able to do networking, like in a detached frame.
     10        It just replaces ThreadableWebSocketChannel::create with SocketProvider::createWebSocketChannel
     11        which does the same thing as ThreadableWebSocketChannel::create for Mac and
     12        Windows WebKit1.  The WebKit2 implementation is the same right now, but it will
     13        be replaced by a proxy that will do the WebSocket operations in the NetworkProcess.
     14
     15        * Modules/websockets/ThreadableWebSocketChannel.cpp: Removed.
     16        * Modules/websockets/ThreadableWebSocketChannel.h:
     17        (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
     18        * Modules/websockets/WebSocket.cpp:
     19        (WebCore::WebSocket::connect):
     20        * Modules/websockets/WebSocketChannel.h:
     21        * Modules/websockets/WorkerThreadableWebSocketChannel.h:
     22        * WebCore.xcodeproj/project.pbxproj:
     23        * dom/Document.cpp:
     24        (WebCore::Document::idbConnectionProxy):
     25        (WebCore::Document::socketProvider):
     26        (WebCore::Document::canNavigate):
     27        * dom/Document.h:
     28        (WebCore::Document::notifyRemovePendingSheetIfNeeded):
     29        * dom/ScriptExecutionContext.h:
     30        * inspector/InspectorOverlay.cpp:
     31        (WebCore::InspectorOverlay::overlayPage):
     32        * loader/EmptyClients.cpp:
     33        (WebCore::EmptyEditorClient::registerRedoStep):
     34        (WebCore::EmptySocketProvider::createWebSocketChannel):
     35        * loader/EmptyClients.h:
     36        * page/Page.h:
     37        * page/PageConfiguration.cpp:
     38        (WebCore::PageConfiguration::PageConfiguration):
     39        * page/PageConfiguration.h:
     40        * page/SocketProvider.h:
     41        (WebCore::SocketProvider::~SocketProvider):
     42        * svg/graphics/SVGImage.cpp:
     43        (WebCore::SVGImage::dataChanged):
     44        * workers/DedicatedWorkerGlobalScope.cpp:
     45        (WebCore::DedicatedWorkerGlobalScope::create):
     46        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
     47        * workers/DedicatedWorkerGlobalScope.h:
     48        * workers/DedicatedWorkerThread.cpp:
     49        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
     50        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
     51        (WebCore::DedicatedWorkerThread::runEventLoop):
     52        * workers/DedicatedWorkerThread.h:
     53        * workers/WorkerGlobalScope.cpp:
     54        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
     55        (WebCore::WorkerGlobalScope::disableEval):
     56        (WebCore::WorkerGlobalScope::socketProvider):
     57        (WebCore::WorkerGlobalScope::idbConnectionProxy):
     58        * workers/WorkerGlobalScope.h:
     59        (WebCore::WorkerGlobalScope::script):
     60        * workers/WorkerMessagingProxy.cpp:
     61        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
     62        * workers/WorkerThread.cpp:
     63        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
     64        (WebCore::WorkerThread::WorkerThread):
     65        (WebCore::WorkerThread::idbConnectionProxy):
     66        (WebCore::WorkerThread::socketProvider):
     67        * workers/WorkerThread.h:
     68        (WebCore::WorkerThread::workerGlobalScope):
     69
    1702016-07-07  Commit Queue  <commit-queue@webkit.org>
    271
  • trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h

    r201880 r202930  
    5252public:
    5353    ThreadableWebSocketChannel() { }
    54     static Ref<ThreadableWebSocketChannel> create(ScriptExecutionContext&, WebSocketChannelClient&);
    5554
    5655    enum SendResult {
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r201880 r202930  
    5151#include "ScriptExecutionContext.h"
    5252#include "SecurityOrigin.h"
     53#include "SocketProvider.h"
    5354#include "ThreadableWebSocketChannel.h"
    5455#include "WebSocketChannel.h"
     
    251252    }
    252253
    253     m_channel = ThreadableWebSocketChannel::create(*scriptExecutionContext(), *this);
     254    if (auto socketProvider = scriptExecutionContext()->socketProvider())
     255        m_channel = socketProvider->createWebSocketChannel(*scriptExecutionContext(), *this);
     256
     257    // Only an EmptySocketProvider can return nullptr, and every ScriptExecutionContext should have a SocketProvider.
     258    RELEASE_ASSERT(m_channel);
    254259
    255260    // FIXME: There is a disagreement about restriction of subprotocols between WebSocket API and hybi-10 protocol
  • trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h

    r201880 r202930  
    120120
    121121private:
    122     WebSocketChannel(Document&, WebSocketChannelClient&);
     122    WEBCORE_EXPORT WebSocketChannel(Document&, WebSocketChannelClient&);
    123123
    124124    bool appendToBuffer(const char* data, size_t len);
  • trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h

    r201880 r202930  
    161161    };
    162162
    163     WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient&, const String& taskMode);
     163    WEBCORE_EXPORT WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient&, const String& taskMode);
    164164
    165165    class WorkerGlobalScopeDidInitializeTask;
  • trunk/Source/WebCore/PlatformWin.cmake

    r201038 r202930  
    168168    dom
    169169    editing
     170    fileapi
    170171    history
    171172    html
     
    185186    Modules/geolocation
    186187    Modules/indexeddb
     188    Modules/websockets
    187189
    188190    Modules/indexeddb/client
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r202889 r202930  
    12901290                2E4346460F546A8200B0F1BA /* Worker.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346340F546A8200B0F1BA /* Worker.h */; };
    12911291                2E4346480F546A8200B0F1BA /* WorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346360F546A8200B0F1BA /* WorkerGlobalScope.cpp */; };
    1292                 2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346370F546A8200B0F1BA /* WorkerGlobalScope.h */; };
     1292                2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346370F546A8200B0F1BA /* WorkerGlobalScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12931293                2E43464B0F546A8200B0F1BA /* WorkerGlobalScopeProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346390F546A8200B0F1BA /* WorkerGlobalScopeProxy.h */; };
    12941294                2E43464C0F546A8200B0F1BA /* WorkerLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E43463A0F546A8200B0F1BA /* WorkerLocation.cpp */; };
     
    13041304                2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */; };
    13051305                2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841B12779ADA0062628B /* FileReaderLoader.h */; };
    1306                 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; };
     1306                2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13071307                2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; };
    13081308                2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; };
     
    19341934                4A0FFAA61AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0FFAA41AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19351935                4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */; };
    1936                 4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; };
     1936                4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19371937                4A4F48A916B0DFC000EDBB29 /* DocumentRuleSets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */; };
    19381938                4A4F48AA16B0DFC000EDBB29 /* DocumentRuleSets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */; };
     
    20102010                510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A30103165EE0049EA54 /* SocketStreamHandleBase.cpp */; };
    20112011                510D4A37103165EE0049EA54 /* SocketStreamHandleBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A31103165EE0049EA54 /* SocketStreamHandleBase.h */; };
    2012                 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; };
     2012                510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    20132013                511EC1271C50AACA0032F983 /* IDBSerialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1251C50AA570032F983 /* IDBSerialization.cpp */; };
    20142014                511EC1281C50AACA0032F983 /* IDBSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC1261C50AA570032F983 /* IDBSerialization.h */; };
     
    39593959                97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AA3CA4145237CC003E1DA6 /* EventTargetInterfaces.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39603960                97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCF814FA09D5007457AE /* CloseEvent.h */; };
    3961                 97AABD1614FA09D5007457AE /* ThreadableWebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */; };
    3962                 97AABD1714FA09D5007457AE /* ThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */; };
     3961                97AABD1714FA09D5007457AE /* ThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39633962                97AABD1814FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */; };
    3964                 97AABD1914FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */; };
     3963                97AABD1914FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABCFE14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39653964                97AABD1A14FA09D5007457AE /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFF14FA09D5007457AE /* WebSocket.cpp */; };
    39663965                97AABD1B14FA09D5007457AE /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0014FA09D5007457AE /* WebSocket.h */; };
    39673966                97AABD1D14FA09D5007457AE /* WebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0214FA09D5007457AE /* WebSocketChannel.cpp */; };
    3968                 97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0314FA09D5007457AE /* WebSocketChannel.h */; };
    3969                 97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0414FA09D5007457AE /* WebSocketChannelClient.h */; };
     3967                97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0314FA09D5007457AE /* WebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3968                97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0414FA09D5007457AE /* WebSocketChannelClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39703969                97AABD2014FA09D5007457AE /* WebSocketDeflater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0514FA09D5007457AE /* WebSocketDeflater.cpp */; };
    3971                 97AABD2114FA09D5007457AE /* WebSocketDeflater.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0614FA09D5007457AE /* WebSocketDeflater.h */; };
     3970                97AABD2114FA09D5007457AE /* WebSocketDeflater.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0614FA09D5007457AE /* WebSocketDeflater.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39723971                97AABD2214FA09D5007457AE /* WebSocketExtensionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0714FA09D5007457AE /* WebSocketExtensionDispatcher.cpp */; };
    39733972                97AABD2314FA09D5007457AE /* WebSocketExtensionDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0814FA09D5007457AE /* WebSocketExtensionDispatcher.h */; };
    3974                 97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0914FA09D5007457AE /* WebSocketExtensionProcessor.h */; };
    3975                 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0A14FA09D5007457AE /* WebSocketFrame.h */; };
     3973                97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0914FA09D5007457AE /* WebSocketExtensionProcessor.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3974                97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0A14FA09D5007457AE /* WebSocketFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39763975                97AABD2614FA09D5007457AE /* WebSocketHandshake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0B14FA09D5007457AE /* WebSocketHandshake.cpp */; };
    39773976                97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */; };
    39783977                97AABD2C14FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD1114FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp */; };
    3979                 97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */; };
     3978                97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39803979                97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37569E0013AF172C00CDBA8E /* SharedBufferChunkReader.cpp */; };
    39813980                97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 37569E0213AF172C00CDBA8E /* SharedBufferChunkReader.h */; };
     
    42234222                A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    42244223                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E2642E14748991005A8588 /* WorkerEventQueue.cpp */; };
    4225                 A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3E2642F14748991005A8588 /* WorkerEventQueue.h */; };
     4224                A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3E2642F14748991005A8588 /* WorkerEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    42264225                A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */; };
    42274226                A4226E5A1163D667008B8397 /* JSHTMLProgressElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */; };
     
    65536552                E1A3162E134BC32D007C9A4F /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */; };
    65546553                E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */; };
    6555                 E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; };
     6554                E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    65566555                E1A643FD0EC097A000779668 /* WorkerScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */; };
    65576556                E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */; };
     
    1170611705                97AABCF814FA09D5007457AE /* CloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloseEvent.h; sourceTree = "<group>"; };
    1170711706                97AABCF914FA09D5007457AE /* CloseEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CloseEvent.idl; sourceTree = "<group>"; };
    11708                 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannel.cpp; sourceTree = "<group>"; };
    1170911707                97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableWebSocketChannel.h; sourceTree = "<group>"; };
    1171011708                97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannelClientWrapper.cpp; sourceTree = "<group>"; };
     
    1993419932                                97AABCF814FA09D5007457AE /* CloseEvent.h */,
    1993519933                                97AABCF914FA09D5007457AE /* CloseEvent.idl */,
    19936                                 97AABCFB14FA09D5007457AE /* ThreadableWebSocketChannel.cpp */,
    1993719934                                97AABCFC14FA09D5007457AE /* ThreadableWebSocketChannel.h */,
    1993819935                                97AABCFD14FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp */,
     
    3223832235                                976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
    3223932236                                0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
    32240                                 97AABD1614FA09D5007457AE /* ThreadableWebSocketChannel.cpp in Sources */,
    3224132237                                97AABD1814FA09D5007457AE /* ThreadableWebSocketChannelClientWrapper.cpp in Sources */,
    3224232238                                51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
  • trunk/Source/WebCore/dom/Document.cpp

    r202895 r202930  
    163163#include "Settings.h"
    164164#include "ShadowRoot.h"
     165#include "SocketProvider.h"
    165166#include "StorageEvent.h"
    166167#include "StyleProperties.h"
     
    542543    , m_hasInjectedPlugInsScript(false)
    543544    , m_hasStyleWithViewportUnits(false)
     545#if ENABLE(WEB_SOCKETS)
     546    , m_socketProvider(page() ? &page()->socketProvider() : nullptr)
     547#endif
    544548{
    545549    allDocuments().add(this);
     
    30883092#endif // ENABLE(INDEXED_DATABASE)
    30893093
     3094#if ENABLE(WEB_SOCKETS)
     3095SocketProvider* Document::socketProvider()
     3096{
     3097    return m_socketProvider.get();
     3098}
     3099#endif
     3100   
    30903101bool Document::canNavigate(Frame* targetFrame)
    30913102{
  • trunk/Source/WebCore/dom/Document.h

    r202769 r202930  
    666666    IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
    667667#endif
     668#if ENABLE(WEB_SOCKETS)
     669    SocketProvider* socketProvider() final;
     670#endif
    668671
    669672    bool canNavigate(Frame* targetFrame);
     
    17951798    RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
    17961799#endif
     1800#if ENABLE(WEB_SOCKETS)
     1801    RefPtr<SocketProvider> m_socketProvider;
     1802#endif
    17971803};
    17981804
  • trunk/Source/WebCore/dom/ScriptExecutionContext.h

    r202439 r202930  
    6161class ResourceRequest;
    6262class SecurityOrigin;
     63class SocketProvider;
    6364class URL;
    6465
     
    8788#if ENABLE(INDEXED_DATABASE)
    8889    virtual IDBClient::IDBConnectionProxy* idbConnectionProxy() = 0;
     90#endif
     91#if ENABLE(WEB_SOCKETS)
     92    virtual SocketProvider* socketProvider() = 0;
    8993#endif
    9094
  • trunk/Source/WebCore/inspector/InspectorOverlay.cpp

    r202198 r202930  
    865865        return m_overlayPage.get();
    866866
    867     PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), makeUniqueRef<EmptySocketProvider>());
     867    PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), EmptySocketProvider::create());
    868868    fillWithEmptyClients(pageConfiguration);
    869869    m_overlayPage = std::make_unique<Page>(WTFMove(pageConfiguration));
  • trunk/Source/WebCore/loader/EmptyClients.cpp

    r202570 r202930  
    4646#include "StorageNamespace.h"
    4747#include "StorageNamespaceProvider.h"
     48#include "ThreadableWebSocketChannel.h"
    4849#include "UserContentProvider.h"
    4950#include <wtf/NeverDestroyed.h>
     
    264265{
    265266}
    266 
    267 }
     267   
     268RefPtr<ThreadableWebSocketChannel> EmptySocketProvider::createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&)
     269{
     270    return nullptr;
     271}
     272
     273}
  • trunk/Source/WebCore/loader/EmptyClients.h

    r202410 r202930  
    645645
    646646class EmptySocketProvider final : public SocketProvider {
    647 };
    648    
     647public:
     648    virtual ~EmptySocketProvider() { }
     649    static Ref<EmptySocketProvider> create() { return adoptRef(*new EmptySocketProvider); }
     650    RefPtr<ThreadableWebSocketChannel> createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&) override;
     651};
     652
    649653void fillWithEmptyClients(PageConfiguration&);
    650654
  • trunk/Source/WebCore/page/Page.h

    r202183 r202930  
    697697    unsigned m_forbidPromptsDepth;
    698698
    699     UniqueRef<SocketProvider> m_socketProvider;
     699    Ref<SocketProvider> m_socketProvider;
    700700    Ref<ApplicationCacheStorage> m_applicationCacheStorage;
    701701    Ref<DatabaseProvider> m_databaseProvider;
  • trunk/Source/WebCore/page/PageConfiguration.cpp

    r202005 r202930  
    3939namespace WebCore {
    4040
    41 PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, UniqueRef<SocketProvider>&& socketProvider)
     41PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider)
    4242    : editorClient(WTFMove(editorClient))
    4343    , socketProvider(WTFMove(socketProvider))
  • trunk/Source/WebCore/page/PageConfiguration.h

    r202345 r202930  
    5858    WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
    5959public:
    60     WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, UniqueRef<SocketProvider>&&);
     60    WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&);
    6161    WEBCORE_EXPORT ~PageConfiguration();
    6262
     
    6767#endif
    6868    UniqueRef<EditorClient> editorClient;
    69     UniqueRef<SocketProvider> socketProvider;
     69    Ref<SocketProvider> socketProvider;
    7070    DragClient* dragClient { nullptr };
    7171    InspectorClient* inspectorClient { nullptr };
  • trunk/Source/WebCore/page/SocketProvider.h

    r202005 r202930  
    2626#pragma once
    2727
     28#include <wtf/RefPtr.h>
     29#include <wtf/ThreadSafeRefCounted.h>
     30
    2831namespace WebCore {
    2932
    30 class SocketProvider {
     33class ScriptExecutionContext;
     34class ThreadableWebSocketChannel;
     35class WebSocketChannelClient;
     36
     37class SocketProvider : public ThreadSafeRefCounted<SocketProvider> {
    3138public:
     39    virtual RefPtr<ThreadableWebSocketChannel> createWebSocketChannel(ScriptExecutionContext&, WebSocketChannelClient&) = 0;
    3240    virtual ~SocketProvider() { };
    3341};
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r202927 r202930  
    381381
    382382    if (allDataReceived) {
    383         PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), makeUniqueRef<EmptySocketProvider>());
     383        PageConfiguration pageConfiguration(makeUniqueRef<EmptyEditorClient>(), EmptySocketProvider::create());
    384384        fillWithEmptyClients(pageConfiguration);
    385385        m_chromeClient = std::make_unique<SVGImageChromeClient>(this);
  • trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp

    r201675 r202930  
    4242namespace WebCore {
    4343
    44 Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
     44Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
    4545{
    46     Ref<DedicatedWorkerGlobalScope> context = adoptRef(*new DedicatedWorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy));
     46    Ref<DedicatedWorkerGlobalScope> context = adoptRef(*new DedicatedWorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider));
    4747    if (!shouldBypassMainWorldContentSecurityPolicy)
    4848        context->applyContentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders);
     
    5050}
    5151
    52 DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
    53     : WorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy)
     52DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
     53    : WorkerGlobalScope(url, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider)
    5454{
    5555}
  • trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h

    r201675 r202930  
    4343    public:
    4444        typedef WorkerGlobalScope Base;
    45         static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
     45        static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
    4646        virtual ~DedicatedWorkerGlobalScope();
    4747
     
    6161
    6262    private:
    63         DedicatedWorkerGlobalScope(const URL&, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
     63        DedicatedWorkerGlobalScope(const URL&, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
    6464    };
    6565
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp

    r199853 r202930  
    3939namespace WebCore {
    4040
    41 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)
    42     : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy)
     41DedicatedWorkerThread::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)
     42    : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, connectionProxy, socketProvider)
    4343    , m_workerObjectProxy(workerObjectProxy)
    4444{
     
    5151Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin)
    5252{
    53     return DedicatedWorkerGlobalScope::create(url, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, idbConnectionProxy());
     53    return DedicatedWorkerGlobalScope::create(url, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, idbConnectionProxy(), socketProvider());
    5454}
    5555
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.h

    r199853 r202930  
    5454
    5555private:
    56     DedicatedWorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*);
     56    DedicatedWorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
    5757
    5858    WorkerObjectProxy& m_workerObjectProxy;
  • trunk/Source/WebCore/workers/WorkerGlobalScope.cpp

    r201594 r202930  
    4444#include "SecurityOrigin.h"
    4545#include "SecurityOriginPolicy.h"
     46#include "SocketProvider.h"
    4647#include "URL.h"
    4748#include "WorkerLocation.h"
     
    6465namespace WebCore {
    6566
    66 WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy* connectionProxy)
     67WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, WorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
    6768    : m_url(url)
    6869    , m_userAgent(userAgent)
     
    7677    , m_connectionProxy(connectionProxy)
    7778#endif
     79#if ENABLE(WEB_SOCKETS)
     80    , m_socketProvider(socketProvider)
     81#endif
    7882{
    7983#if !ENABLE(INDEXED_DATABASE)
     
    123127    m_script->disableEval(errorMessage);
    124128}
     129
     130#if ENABLE(WEB_SOCKETS)
     131SocketProvider* WorkerGlobalScope::socketProvider()
     132{
     133    return m_socketProvider.get();
     134}
     135#endif
    125136
    126137#if ENABLE(INDEXED_DATABASE)
  • trunk/Source/WebCore/workers/WorkerGlobalScope.h

    r202105 r202930  
    3737#include <wtf/Assertions.h>
    3838#include <wtf/HashMap.h>
    39 #include <wtf/PassRefPtr.h>
    4039#include <wtf/RefCounted.h>
    4140#include <wtf/RefPtr.h>
     
    8079    IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
    8180    void stopIndexedDatabase();
     81#endif
     82
     83#if ENABLE(WEB_SOCKETS)
     84    SocketProvider* socketProvider() final;
    8285#endif
    8386
     
    148151
    149152protected:
    150     WorkerGlobalScope(const URL&, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin, IDBClient::IDBConnectionProxy*);
     153    WorkerGlobalScope(const URL&, const String& userAgent, WorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
    151154    void applyContentSecurityPolicyResponseHeaders(const ContentSecurityPolicyResponseHeaders&);
    152155
     
    189192    RefPtr<IDBClient::IDBConnectionProxy> m_connectionProxy;
    190193#endif
     194#if ENABLE(WEB_SOCKETS)
     195    RefPtr<SocketProvider> m_socketProvider;
     196#endif
    191197};
    192198
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r202313 r202930  
    8080
    8181#if ENABLE(INDEXED_DATABASE)
    82     RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), document.idbConnectionProxy());
     82    IDBClient::IDBConnectionProxy* proxy = document.idbConnectionProxy();
    8383#else
    84     RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), nullptr);
     84    IDBClient::IDBConnectionProxy* proxy = nullptr;
    8585#endif
     86
     87#if ENABLE(WEB_SOCKETS)
     88    SocketProvider* socketProvider = document.socketProvider();
     89#else
     90    SocketProvider* socketProvider = nullptr;
     91#endif
     92
     93    RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), proxy, socketProvider);
    8694
    8795    workerThreadCreated(thread);
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r202242 r202930  
    3434#include "ScriptSourceCode.h"
    3535#include "SecurityOrigin.h"
     36#include "SocketProvider.h"
    3637#include "ThreadGlobalData.h"
    3738#include "URL.h"
     
    9495}
    9596
    96 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)
     97WorkerThread::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)
    9798    : m_threadID(0)
    9899    , m_workerLoaderProxy(workerLoaderProxy)
     
    104105#if ENABLE(INDEXED_DATABASE)
    105106    , m_idbConnectionProxy(connectionProxy)
     107#endif
     108#if ENABLE(WEB_SOCKETS)
     109    , m_socketProvider(socketProvider)
    106110#endif
    107111{
     
    254258}
    255259
     260SocketProvider* WorkerThread::socketProvider()
     261{
     262#if ENABLE(WEB_SOCKETS)
     263    return m_socketProvider.get();
     264#else
     265    return nullptr;
     266#endif
     267}
     268
    256269} // namespace WebCore
  • trunk/Source/WebCore/workers/WorkerThread.h

    r199853 r202930  
    3939class NotificationClient;
    4040class SecurityOrigin;
     41class SocketProvider;
    4142class WorkerGlobalScope;
    4243class WorkerLoaderProxy;
     
    7374
    7475protected:
    75     WorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*);
     76    WorkerThread(const URL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
    7677
    7778    // Factory method for creating a new worker context for the thread.
     
    8485
    8586    IDBClient::IDBConnectionProxy* idbConnectionProxy();
     87    SocketProvider* socketProvider();
    8688
    8789private:
     
    107109    RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
    108110#endif
     111#if ENABLE(WEB_SOCKETS)
     112    RefPtr<SocketProvider> m_socketProvider;
     113#endif
    109114};
    110115
  • trunk/Source/WebKit/ChangeLog

    r202799 r202930  
     12016-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use SocketProvider to create WebSocketChannels
     4        https://bugs.webkit.org/show_bug.cgi?id=158776
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * PlatformMac.cmake:
     9        * PlatformWin.cmake:
     10        * WebKit.xcodeproj/project.pbxproj:
     11
    1122016-07-03  Per Arne Vollan  <pvollan@apple.com>
    213
  • trunk/Source/WebKit/PlatformMac.cmake

    r201962 r202930  
    115115    mac/Misc/WebNSWindowExtras.m
    116116    mac/Misc/WebSharingServicePickerController.mm
     117    mac/Misc/WebSocketProvider.mm
    117118    mac/Misc/WebStringTruncator.mm
    118119    mac/Misc/WebUserContentURLPattern.mm
  • trunk/Source/WebKit/PlatformWin.cmake

    r202799 r202930  
    196196    win/WebSecurityOrigin.cpp
    197197    win/WebSerializedJSValue.cpp
     198    win/WebSocketProvider.cpp
    198199    win/WebTextRenderer.cpp
    199200    win/WebURLAuthenticationChallenge.cpp
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r202346 r202930  
    148148                598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */; };
    149149                598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
     150                5C7706701D111B020012700F /* WebSocketProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C77066F1D111B020012700F /* WebSocketProvider.mm */; };
     151                5C7706721D111B220012700F /* QuickDrawCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7706711D111B220012700F /* QuickDrawCompatibility.h */; };
    150152                5C7C88DA1D0F3BF2009D2F6D /* WebSocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.h */; };
    151153                5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    650652                598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMockInternal.h; sourceTree = "<group>"; };
    651653                598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProvider.h; sourceTree = "<group>"; };
     654                5C77066F1D111B020012700F /* WebSocketProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSocketProvider.mm; sourceTree = "<group>"; };
     655                5C7706711D111B220012700F /* QuickDrawCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickDrawCompatibility.h; sourceTree = "<group>"; };
    652656                5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketProvider.h; sourceTree = "<group>"; };
    653657                5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
     
    10941098                        isa = PBXGroup;
    10951099                        children = (
     1100                                5C7706711D111B220012700F /* QuickDrawCompatibility.h */,
     1101                                5C77066F1D111B020012700F /* WebSocketProvider.mm */,
    10961102                                5C7C88D91D0F3BF2009D2F6D /* WebSocketProvider.h */,
    10971103                                A10C1D2018202FAF0036883A /* ios */,
     
    19591965                                C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
    19601966                                070F549B17F1E42B00169E04 /* WebUserMediaClient.h in Headers */,
     1967                                5C7706721D111B220012700F /* QuickDrawCompatibility.h in Headers */,
    19611968                                939810700824BF01008DF038 /* WebView.h in Headers */,
    19621969                                BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */,
     
    22722279                                ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */,
    22732280                                BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */,
     2281                                5C7706701D111B020012700F /* WebSocketProvider.mm in Sources */,
    22742282                                072E5F461ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm in Sources */,
    22752283                                A10C1D731820300E0036883A /* WebMIMETypeRegistry.mm in Sources */,
  • trunk/Source/WebKit/mac/ChangeLog

    r202890 r202930  
     12016-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use SocketProvider to create WebSocketChannels
     4        https://bugs.webkit.org/show_bug.cgi?id=158776
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * Misc/WebSocketProvider.mm: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
     9        (WebSocketProvider::createWebSocketChannel):
     10        (WebCore::ThreadableWebSocketChannel::create): Deleted.
     11        * Misc/WebSocketProvider.h:
     12        * WebView/WebView.mm:
     13        (-[WebView _commonInitializationWithFrameName:groupName:]):
     14        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
     15
    1162016-07-06  Benjamin Poulain  <bpoulain@apple.com>
    217
  • trunk/Source/WebKit/mac/Misc/WebSocketProvider.h

    r202005 r202930  
    2626#pragma once
    2727
    28 #include <WebCore/SocketProvider.h>
     28#import <WebCore/SocketProvider.h>
    2929
    3030class WebSocketProvider final : public WebCore::SocketProvider {
     31public:
     32    static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
     33    RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
     34    virtual ~WebSocketProvider() { }
    3135};
  • trunk/Source/WebKit/mac/Misc/WebSocketProvider.mm

    r202929 r202930  
    2929 */
    3030
    31 #include "config.h"
     31#import "WebSocketProvider.h"
    3232
    3333#if ENABLE(WEB_SOCKETS)
    3434
    35 #include "ThreadableWebSocketChannel.h"
     35#import <WebCore/Document.h>
     36#import <WebCore/ScriptExecutionContext.h>
     37#import <WebCore/ThreadableWebSocketChannelClientWrapper.h>
     38#import <WebCore/WebSocketChannel.h>
     39#import <WebCore/WebSocketChannelClient.h>
     40#import <WebCore/WorkerGlobalScope.h>
     41#import <WebCore/WorkerRunLoop.h>
     42#import <WebCore/WorkerThread.h>
     43#import <WebCore/WorkerThreadableWebSocketChannel.h>
     44#import <wtf/text/StringBuilder.h>
    3645
    37 #include "Document.h"
    38 #include "ScriptExecutionContext.h"
    39 #include "ThreadableWebSocketChannelClientWrapper.h"
    40 #include "WebSocketChannel.h"
    41 #include "WebSocketChannelClient.h"
    42 #include "WorkerGlobalScope.h"
    43 #include "WorkerRunLoop.h"
    44 #include "WorkerThread.h"
    45 #include "WorkerThreadableWebSocketChannel.h"
    46 #include <wtf/text/StringBuilder.h>
    47 
    48 namespace WebCore {
     46using namespace WebCore;
    4947
    5048static const char webSocketChannelMode[] = "webSocketChannelMode";
    5149
    52 Ref<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(ScriptExecutionContext& context, WebSocketChannelClient& client)
     50RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
    5351{
    5452    if (is<WorkerGlobalScope>(context)) {
     
    6462}
    6563
    66 } // namespace WebCore
    67 
    6864#endif // ENABLE(WEB_SOCKETS)
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r202728 r202930  
    997997    _private->group->addWebView(self);
    998998
    999     PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), makeUniqueRef<WebSocketProvider>());
     999    PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), WebSocketProvider::create());
    10001000#if !PLATFORM(IOS)
    10011001    pageConfiguration.chromeClient = new WebChromeClient(self);
     
    12471247    _private->group->addWebView(self);
    12481248
    1249     PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), makeUniqueRef<WebSocketProvider>());
     1249    PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(self), WebSocketProvider::create());
    12501250    pageConfiguration.chromeClient = new WebChromeClientIOS(self);
    12511251#if ENABLE(DRAG_SUPPORT)
  • trunk/Source/WebKit/win/ChangeLog

    r202861 r202930  
     12016-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use SocketProvider to create WebSocketChannels
     4        https://bugs.webkit.org/show_bug.cgi?id=158776
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
     9        (WebSocketProvider::createWebSocketChannel):
     10        (WebCore::ThreadableWebSocketChannel::create): Deleted.
     11        * WebSocketProvider.h:
     12
    1132016-07-06  Per Arne Vollan  <pvollan@apple.com>
    214
  • trunk/Source/WebKit/win/WebSocketProvider.cpp

    r202929 r202930  
    3030
    3131#include "config.h"
     32#include "WebSocketProvider.h"
    3233
    3334#if ENABLE(WEB_SOCKETS)
    3435
    35 #include "ThreadableWebSocketChannel.h"
    36 
    37 #include "Document.h"
    38 #include "ScriptExecutionContext.h"
    39 #include "ThreadableWebSocketChannelClientWrapper.h"
    40 #include "WebSocketChannel.h"
    41 #include "WebSocketChannelClient.h"
    42 #include "WorkerGlobalScope.h"
    43 #include "WorkerRunLoop.h"
    44 #include "WorkerThread.h"
    45 #include "WorkerThreadableWebSocketChannel.h"
     36#include <WebCore/Document.h>
     37#include <WebCore/ScriptExecutionContext.h>
     38#include <WebCore/ThreadableWebSocketChannelClientWrapper.h>
     39#include <WebCore/WebSocketChannel.h>
     40#include <WebCore/WebSocketChannelClient.h>
     41#include <WebCore/WorkerGlobalScope.h>
     42#include <WebCore/WorkerRunLoop.h>
     43#include <WebCore/WorkerThread.h>
     44#include <WebCore/WorkerThreadableWebSocketChannel.h>
    4645#include <wtf/text/StringBuilder.h>
    4746
    48 namespace WebCore {
     47using namespace WebCore;
    4948
    5049static const char webSocketChannelMode[] = "webSocketChannelMode";
    5150
    52 Ref<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(ScriptExecutionContext& context, WebSocketChannelClient& client)
     51RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
    5352{
    5453    if (is<WorkerGlobalScope>(context)) {
     
    6463}
    6564
    66 } // namespace WebCore
    67 
    6865#endif // ENABLE(WEB_SOCKETS)
  • trunk/Source/WebKit/win/WebSocketProvider.h

    r202005 r202930  
    2929
    3030class WebSocketProvider final : public WebCore::SocketProvider {
     31public:
     32    static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
     33    RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
     34    virtual ~WebSocketProvider() { }
    3135};
  • trunk/Source/WebKit2/CMakeLists.txt

    r202889 r202930  
    134134    "${WEBCORE_DIR}/svg/graphics"
    135135    "${WEBCORE_DIR}/svg/properties"
     136    "${WEBCORE_DIR}/workers"
    136137    "${JAVASCRIPTCORE_DIR}"
    137138    "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
     
    574575    WebProcess/Network/WebLoaderStrategy.cpp
    575576    WebProcess/Network/WebResourceLoader.cpp
     577    WebProcess/Network/WebSocketProvider.cpp
    576578
    577579    WebProcess/Notifications/NotificationPermissionRequestManager.cpp
  • trunk/Source/WebKit2/ChangeLog

    r202927 r202930  
     12016-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use SocketProvider to create WebSocketChannels
     4        https://bugs.webkit.org/show_bug.cgi?id=158776
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * CMakeLists.txt:
     9        * WebKit2.xcodeproj/project.pbxproj:
     10        * WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
     11        (WebKit::WebSocketProvider::createWebSocketChannel):
     12        (WebCore::ThreadableWebSocketChannel::create): Deleted.
     13        * WebProcess/Network/WebSocketProvider.h:
     14        * WebProcess/WebPage/WebPage.cpp:
     15        (WebKit::m_shouldDispatchFakeMouseMoveEvents):
     16
    1172016-07-07  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r202889 r202930  
    10461046                5C20CBA01BB1ECD800895BB1 /* NetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */; };
    10471047                5C298DA01C3DF02100470AFE /* PendingDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */; };
     1048                5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */; };
    10481049                5C85C7881C3F23CE0061A4FA /* PendingDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */; };
    10491050                5CBC9B8D1C65279C00A8FDCF /* NetworkDataTaskCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC9B8B1C65257300A8FDCF /* NetworkDataTaskCocoa.mm */; };
     
    30943095                5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkSession.h; path = NetworkProcess/NetworkSession.h; sourceTree = "<group>"; };
    30953096                5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDownload.h; path = NetworkProcess/Downloads/PendingDownload.h; sourceTree = "<group>"; };
     3097                5C7706731D111D8B0012700F /* WebSocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketProvider.cpp; path = Network/WebSocketProvider.cpp; sourceTree = "<group>"; };
    30963098                5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketProvider.h; path = Network/WebSocketProvider.h; sourceTree = "<group>"; };
    30973099                5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PendingDownload.cpp; path = NetworkProcess/Downloads/PendingDownload.cpp; sourceTree = "<group>"; };
     
    53345336                        isa = PBXGroup;
    53355337                        children = (
     5338                                5C7706731D111D8B0012700F /* WebSocketProvider.cpp */,
    53365339                                5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */,
    53375340                                5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */,
     
    92609263                                CD19A26D1A13E82A008D650E /* WebDiagnosticLoggingClient.cpp in Sources */,
    92619264                                1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */,
     9265                                5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */,
    92629266                                BC111A5D112F4FBB00337BAB /* WebDragClient.cpp in Sources */,
    92639267                                C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */,
  • trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.cpp

    r202929 r202930  
    3030
    3131#include "config.h"
     32#include "WebSocketProvider.h"
    3233
    3334#if ENABLE(WEB_SOCKETS)
    3435
    35 #include "ThreadableWebSocketChannel.h"
    36 
    37 #include "Document.h"
    38 #include "ScriptExecutionContext.h"
    39 #include "ThreadableWebSocketChannelClientWrapper.h"
    40 #include "WebSocketChannel.h"
    41 #include "WebSocketChannelClient.h"
    42 #include "WorkerGlobalScope.h"
    43 #include "WorkerRunLoop.h"
    44 #include "WorkerThread.h"
    45 #include "WorkerThreadableWebSocketChannel.h"
     36#include <WebCore/Document.h>
     37#include <WebCore/ScriptExecutionContext.h>
     38#include <WebCore/ThreadableWebSocketChannelClientWrapper.h>
     39#include <WebCore/WebSocketChannel.h>
     40#include <WebCore/WebSocketChannelClient.h>
     41#include <WebCore/WorkerGlobalScope.h>
     42#include <WebCore/WorkerRunLoop.h>
     43#include <WebCore/WorkerThread.h>
     44#include <WebCore/WorkerThreadableWebSocketChannel.h>
    4645#include <wtf/text/StringBuilder.h>
    4746
    48 namespace WebCore {
     47using namespace WebCore;
     48
     49namespace WebKit {
    4950
    5051static const char webSocketChannelMode[] = "webSocketChannelMode";
    5152
    52 Ref<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(ScriptExecutionContext& context, WebSocketChannelClient& client)
     53RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(ScriptExecutionContext& context, WebSocketChannelClient& client)
    5354{
     55    // FIXME: This should return a proxy so we can do the actual network interactions in the NetworkProcess.
    5456    if (is<WorkerGlobalScope>(context)) {
    5557        WorkerGlobalScope& workerGlobalScope = downcast<WorkerGlobalScope>(context);
     
    6466}
    6567
    66 } // namespace WebCore
     68} // namespace WebKit
    6769
    6870#endif // ENABLE(WEB_SOCKETS)
  • trunk/Source/WebKit2/WebProcess/Network/WebSocketProvider.h

    r202005 r202930  
    3131
    3232class WebSocketProvider final : public WebCore::SocketProvider {
     33public:
     34    static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
     35    RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::ScriptExecutionContext&, WebCore::WebSocketChannelClient&) override;
     36    virtual ~WebSocketProvider() { }
    3337};
    3438
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r202889 r202930  
    389389#endif
    390390
    391     PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(this), makeUniqueRef<WebSocketProvider>());
     391    PageConfiguration pageConfiguration(makeUniqueRef<WebEditorClient>(this), WebSocketProvider::create());
    392392    pageConfiguration.chromeClient = new WebChromeClient(this);
    393393#if ENABLE(CONTEXT_MENUS)
Note: See TracChangeset for help on using the changeset viewer.