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

Unified Diff: cc/trees/proxy.cc

Issue 292493006: cc: BlockingTaskRunner without MessageLoopProxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mailbox::Generate Created 6 years, 7 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 | « cc/trees/proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/proxy.cc
diff --git a/cc/trees/proxy.cc b/cc/trees/proxy.cc
index 66967a645c230e9a475978a793db8cb664b66cc5..a8f7b26fb04a150c7ad2f58c31553a59dc625997 100644
--- a/cc/trees/proxy.cc
+++ b/cc/trees/proxy.cc
@@ -21,10 +21,14 @@ base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const {
bool Proxy::IsMainThread() const {
#if DCHECK_IS_ON
- DCHECK(main_task_runner_.get());
if (impl_thread_is_overridden_)
return false;
- return main_task_runner_->BelongsToCurrentThread();
+
+ bool is_main_thread = base::PlatformThread::CurrentId() == main_thread_id_;
+ if (is_main_thread && main_task_runner_.get()) {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+ }
+ return is_main_thread;
#else
return true;
#endif
@@ -68,6 +72,7 @@ Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
impl_task_runner_(impl_task_runner) {
#else
impl_task_runner_(impl_task_runner),
+ main_thread_id_(base::PlatformThread::CurrentId()),
impl_thread_is_overridden_(false),
is_main_thread_blocked_(false) {
#endif
« no previous file with comments | « cc/trees/proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698