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

Unified Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.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/core/loader/ThreadableLoaderTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
index 6f23acd87d90d83daeb68c080cc522190dc39f25..168873b02c1942480707b7c68845644a01e269f5 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -4,7 +4,9 @@
#include "core/loader/ThreadableLoader.h"
+#include <memory>
#include "core/loader/DocumentThreadableLoader.h"
+#include "core/loader/LoadingContext.h"
#include "core/loader/ThreadableLoaderClient.h"
#include "core/loader/WorkerThreadableLoader.h"
#include "core/testing/DummyPageHolder.h"
@@ -32,7 +34,6 @@
#include "wtf/Functional.h"
#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
-#include <memory>
namespace blink {
@@ -241,6 +242,7 @@ class WorkerThreadableLoaderTestHelper : public ThreadableLoaderTestHelper,
ParentFrameTaskRunners::create(&m_dummyPageHolder->frame());
m_workerThread = WTF::wrapUnique(new WorkerThreadForTest(
this, *m_mockWorkerReportingProxy, m_parentFrameTaskRunners.get()));
+ m_loadingContext = LoadingContext::create(document());
expectWorkerLifetimeReportingCalls();
m_workerThread->startWithSourceCode(m_securityOrigin.get(),
@@ -340,7 +342,9 @@ class WorkerThreadableLoaderTestHelper : public ThreadableLoaderTestHelper,
m_workerThread->postTask(location, std::move(task));
}
- ExecutionContext* getLoaderExecutionContext() override { return &document(); }
+ LoadingContext* getLoadingContext() override {
+ return m_loadingContext.get();
+ }
RefPtr<SecurityOrigin> m_securityOrigin;
std::unique_ptr<MockWorkerReportingProxy> m_mockWorkerReportingProxy;
@@ -352,6 +356,8 @@ class WorkerThreadableLoaderTestHelper : public ThreadableLoaderTestHelper,
Checkpoint m_checkpoint;
// |m_loader| must be touched only from the worker thread only.
CrossThreadPersistent<ThreadableLoader> m_loader;
+
+ Persistent<LoadingContext> m_loadingContext;
};
class ThreadableLoaderTest

Powered by Google App Engine
This is Rietveld 408576698