Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Side by Side Diff: Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp

Issue 639333003: Delete the old WebSocket implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 #include "core/dom/CrossThreadTask.h" 36 #include "core/dom/CrossThreadTask.h"
37 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/ExecutionContext.h" 38 #include "core/dom/ExecutionContext.h"
39 #include "core/dom/ExecutionContextTask.h" 39 #include "core/dom/ExecutionContextTask.h"
40 #include "core/fileapi/Blob.h" 40 #include "core/fileapi/Blob.h"
41 #include "core/inspector/ScriptCallFrame.h" 41 #include "core/inspector/ScriptCallFrame.h"
42 #include "core/inspector/ScriptCallStack.h" 42 #include "core/inspector/ScriptCallStack.h"
43 #include "core/workers/WorkerGlobalScope.h" 43 #include "core/workers/WorkerGlobalScope.h"
44 #include "core/workers/WorkerLoaderProxy.h" 44 #include "core/workers/WorkerLoaderProxy.h"
45 #include "core/workers/WorkerThread.h" 45 #include "core/workers/WorkerThread.h"
46 #include "modules/websockets/MainThreadWebSocketChannel.h"
47 #include "modules/websockets/NewWebSocketChannelImpl.h" 46 #include "modules/websockets/NewWebSocketChannelImpl.h"
48 #include "platform/RuntimeEnabledFeatures.h"
49 #include "public/platform/Platform.h" 47 #include "public/platform/Platform.h"
50 #include "public/platform/WebWaitableEvent.h" 48 #include "public/platform/WebWaitableEvent.h"
51 #include "wtf/ArrayBuffer.h" 49 #include "wtf/ArrayBuffer.h"
52 #include "wtf/Assertions.h" 50 #include "wtf/Assertions.h"
53 #include "wtf/Functional.h" 51 #include "wtf/Functional.h"
54 #include "wtf/MainThread.h" 52 #include "wtf/MainThread.h"
55 #include "wtf/text/WTFString.h" 53 #include "wtf/text/WTFString.h"
56 54
57 namespace blink { 55 namespace blink {
58 56
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 194
197 Peer::~Peer() 195 Peer::~Peer()
198 { 196 {
199 ASSERT(!isMainThread()); 197 ASSERT(!isMainThread());
200 } 198 }
201 199
202 void Peer::initializeInternal(ExecutionContext* context, const String& sourceURL , unsigned lineNumber) 200 void Peer::initializeInternal(ExecutionContext* context, const String& sourceURL , unsigned lineNumber)
203 { 201 {
204 ASSERT(isMainThread()); 202 ASSERT(isMainThread());
205 Document* document = toDocument(context); 203 Document* document = toDocument(context);
206 if (RuntimeEnabledFeatures::experimentalWebSocketEnabled()) { 204 m_mainWebSocketChannel = NewWebSocketChannelImpl::create(document, this, sou rceURL, lineNumber);
207 m_mainWebSocketChannel = NewWebSocketChannelImpl::create(document, this, sourceURL, lineNumber);
208 } else {
209 m_mainWebSocketChannel = MainThreadWebSocketChannel::create(document, th is, sourceURL, lineNumber);
210 }
211 m_syncHelper->signalWorkerThread(); 205 m_syncHelper->signalWorkerThread();
212 } 206 }
213 207
214 void Peer::connect(const KURL& url, const String& protocol) 208 void Peer::connect(const KURL& url, const String& protocol)
215 { 209 {
216 ASSERT(isMainThread()); 210 ASSERT(isMainThread());
217 ASSERT(m_syncHelper); 211 ASSERT(m_syncHelper);
218 if (!m_mainWebSocketChannel) { 212 if (!m_mainWebSocketChannel) {
219 m_syncHelper->setConnectRequestResult(false); 213 m_syncHelper->setConnectRequestResult(false);
220 } else { 214 } else {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 473
480 void Bridge::trace(Visitor* visitor) 474 void Bridge::trace(Visitor* visitor)
481 { 475 {
482 visitor->trace(m_client); 476 visitor->trace(m_client);
483 visitor->trace(m_workerGlobalScope); 477 visitor->trace(m_workerGlobalScope);
484 visitor->trace(m_syncHelper); 478 visitor->trace(m_syncHelper);
485 visitor->trace(m_peer); 479 visitor->trace(m_peer);
486 } 480 }
487 481
488 } // namespace blink 482 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698