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

Unified Diff: content/test/test_blink_web_unit_test_support.cc

Issue 959803003: web-threads: Create a single instance of WebThread for each blink thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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 | « content/test/test_blink_web_unit_test_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_blink_web_unit_test_support.cc
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index 1bee8c053639a4ac4ec9670b050b86044058cf7e..81a0552b2ebddb2e8981356b68e17e0b99f289b0 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -13,6 +13,7 @@
#include "content/public/common/content_switches.h"
#include "content/renderer/scheduler/renderer_scheduler.h"
#include "content/renderer/scheduler/web_scheduler_impl.h"
+#include "content/renderer/scheduler/webthread_impl_for_scheduler.h"
#include "content/test/mock_webclipboard_impl.h"
#include "content/test/web_gesture_curve_mock.h"
#include "content/test/web_layer_tree_view_impl_for_testing.h"
@@ -60,6 +61,7 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
if (base::MessageLoopProxy::current()) {
renderer_scheduler_ = RendererScheduler::Create();
web_scheduler_.reset(new WebSchedulerImpl(renderer_scheduler_.get()));
+ web_thread_.reset(new WebThreadImplForScheduler(renderer_scheduler_.get()));
}
blink::initialize(this);
@@ -319,4 +321,10 @@ blink::WebScheduler* TestBlinkWebUnitTestSupport::scheduler() {
return web_scheduler_.get();
}
+blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() {
+ if (web_thread_ && web_thread_->isCurrentThread())
+ return web_thread_.get();
+ return BlinkPlatformImpl::currentThread();
+}
+
} // namespace content
« no previous file with comments | « content/test/test_blink_web_unit_test_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698