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

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
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..5e05b79afbaa577c41d4c55354eab8cb2ceeff18 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/LoadingContext.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();
+LoadingContext* WebSharedWorkerImpl::getLoadingContext() {
+ if (!m_loadingContext) {
+ m_loadingContext =
+ LoadingContext::create(*toDocument(m_loadingDocument.get()));
+ }
+ return m_loadingContext;
}
void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) {

Powered by Google App Engine
This is Rietveld 408576698