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

Unified Diff: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp

Issue 2715803004: Introduce ThreadableLoadingContext: make threaded loading code one step away from Document (Closed)
Patch Set: . Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
index 79cf91f758d22b19555cf0fdc66778883584a455..8e70bb7fae1bb3b062e25b835e390e83acc859bf 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
@@ -32,9 +32,9 @@
#include <memory>
#include "core/dom/DOMArrayBuffer.h"
-#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
#include "core/fileapi/Blob.h"
+#include "core/loader/ThreadableLoadingContext.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerThread.h"
@@ -175,13 +175,12 @@ Peer::~Peer() {
}
bool Peer::initialize(std::unique_ptr<SourceLocation> location,
- ExecutionContext* context) {
+ ThreadableLoadingContext* loadingContext) {
DCHECK(isMainThread());
if (wasContextDestroyedBeforeObserverCreation())
return false;
- Document* document = toDocument(context);
- m_mainWebSocketChannel =
- DocumentWebSocketChannel::create(document, this, std::move(location));
+ m_mainWebSocketChannel = DocumentWebSocketChannel::create(
+ loadingContext, this, std::move(location));
return true;
}
@@ -371,11 +370,12 @@ void Bridge::connectOnMainThread(
WebSocketChannelSyncHelper* syncHelper) {
DCHECK(isMainThread());
DCHECK(!m_peer);
- ExecutionContext* loaderContext = loaderProxy->getLoaderExecutionContext();
- if (!loaderContext)
+ ThreadableLoadingContext* loadingContext =
+ loaderProxy->getThreadableLoadingContext();
+ if (!loadingContext)
return;
Peer* peer = new Peer(this, m_loaderProxy, workerThreadLifecycleContext);
- if (peer->initialize(std::move(location), loaderContext)) {
+ if (peer->initialize(std::move(location), loadingContext)) {
m_peer = peer;
syncHelper->setConnectRequestResult(m_peer->connect(url, protocol));
}

Powered by Google App Engine
This is Rietveld 408576698