From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- .../websockets/ThreadableWebSocketChannel.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp') diff --git a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp index 919c60501..18aaa8c12 100644 --- a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp +++ b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp @@ -31,7 +31,6 @@ #include "config.h" #if ENABLE(WEB_SOCKETS) - #include "ThreadableWebSocketChannel.h" #include "Document.h" @@ -43,27 +42,18 @@ #include "WorkerRunLoop.h" #include "WorkerThread.h" #include "WorkerThreadableWebSocketChannel.h" -#include -#include namespace WebCore { -static const char webSocketChannelMode[] = "webSocketChannelMode"; - -PassRefPtr ThreadableWebSocketChannel::create(ScriptExecutionContext* context, WebSocketChannelClient* client) +Ref ThreadableWebSocketChannel::create(ScriptExecutionContext& context, WebSocketChannelClient& client, SocketProvider& provider) { - ASSERT(context); - ASSERT(client); - - if (context->isWorkerGlobalScope()) { - WorkerGlobalScope* workerGlobalScope = static_cast(context); - WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); - String mode = webSocketChannelMode; - mode.append(String::number(runLoop.createUniqueId())); - return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode); + if (is(context)) { + WorkerGlobalScope& workerGlobalScope = downcast(context); + WorkerRunLoop& runLoop = workerGlobalScope.thread().runLoop(); + return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, makeString("webSocketChannelMode", String::number(runLoop.createUniqueId())), provider); } - return WebSocketChannel::create(toDocument(context), client); + return WebSocketChannel::create(downcast(context), client, provider); } } // namespace WebCore -- cgit v1.2.1