summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp')
-rw-r--r--Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
index a272852dc..919c60501 100644
--- a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
+++ b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
@@ -44,7 +44,7 @@
#include "WorkerThread.h"
#include "WorkerThreadableWebSocketChannel.h"
#include <wtf/PassRefPtr.h>
-#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -55,16 +55,15 @@ PassRefPtr<ThreadableWebSocketChannel> ThreadableWebSocketChannel::create(Script
ASSERT(context);
ASSERT(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());
+ if (context->isWorkerGlobalScope()) {
+ WorkerGlobalScope* workerGlobalScope = static_cast<WorkerGlobalScope*>(context);
+ WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop();
+ String mode = webSocketChannelMode;
+ mode.append(String::number(runLoop.createUniqueId()));
+ return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode);
}
- return WebSocketChannel::create(downcast<Document>(context), client);
+ return WebSocketChannel::create(toDocument(context), client);
}
} // namespace WebCore