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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index bbeff5191ed000b5c793392c4f66a85ff6857709..bc785668e0b09a950d708a742953f06d566a1e98 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -30,12 +30,14 @@
#include "web/WebSharedWorkerImpl.h"
+#include <memory>
#include "core/dom/Document.h"
#include "core/events/MessageEvent.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
+#include "core/loader/ThreadableLoadingContext.h"
#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/SharedWorkerGlobalScope.h"
#include "core/workers/SharedWorkerThread.h"
@@ -70,7 +72,6 @@
#include "web/WorkerContentSettingsClient.h"
#include "wtf/Functional.h"
#include "wtf/PtrUtil.h"
-#include <memory>
namespace blink {
@@ -276,9 +277,12 @@ void WebSharedWorkerImpl::postTaskToWorkerGlobalScope(
m_workerThread->postTask(location, std::move(task));
}
-ExecutionContext* WebSharedWorkerImpl::getLoaderExecutionContext() {
- DCHECK(isMainThread());
- return m_loadingDocument.get();
+ThreadableLoadingContext* WebSharedWorkerImpl::getThreadableLoadingContext() {
+ if (!m_loadingContext) {
+ m_loadingContext =
+ ThreadableLoadingContext::create(*toDocument(m_loadingDocument.get()));
+ }
+ return m_loadingContext;
}
void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) {
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698