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

Unified Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.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/web/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index e8ebbf64e98c0bba264578cddefc87697f5e48ec..3135c41469973049a984e8b5e991e2205798430b 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -30,6 +30,7 @@
#include "web/WebEmbeddedWorkerImpl.h"
+#include <memory>
#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContextTask.h"
@@ -38,6 +39,7 @@
#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/FrameLoadRequest.h"
+#include "core/loader/ThreadableLoadingContext.h"
#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -73,7 +75,6 @@
#include "web/WorkerContentSettingsClient.h"
#include "wtf/Functional.h"
#include "wtf/PtrUtil.h"
-#include <memory>
namespace blink {
@@ -275,8 +276,12 @@ void WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(
m_workerThread->postTask(location, std::move(task));
}
-ExecutionContext* WebEmbeddedWorkerImpl::getLoaderExecutionContext() {
- return m_mainFrame->frame()->document();
+ThreadableLoadingContext* WebEmbeddedWorkerImpl::getThreadableLoadingContext() {
+ if (!m_loadingContext) {
+ m_loadingContext =
+ ThreadableLoadingContext::create(*m_mainFrame->frame()->document());
+ }
+ return m_loadingContext;
}
void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() {
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | third_party/WebKit/Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698