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

Side by Side Diff: cc/trees/proxy.cc

Issue 400773002: cc: Parameterize the main thread task runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebView fix. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/proxy.h ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/proxy.h" 5 #include "cc/trees/proxy.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return true; 59 return true;
60 #endif 60 #endif
61 } 61 }
62 62
63 #if DCHECK_IS_ON 63 #if DCHECK_IS_ON
64 void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) { 64 void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) {
65 is_main_thread_blocked_ = is_main_thread_blocked; 65 is_main_thread_blocked_ = is_main_thread_blocked;
66 } 66 }
67 #endif 67 #endif
68 68
69 Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) 69 Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
70 : main_task_runner_(base::MessageLoopProxy::current()), 70 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
71 #if !DCHECK_IS_ON 71 #if !DCHECK_IS_ON
72 impl_task_runner_(impl_task_runner) { 72 : main_task_runner_(main_task_runner), impl_task_runner_(impl_task_runner) {
73 #else 73 #else
74 : main_task_runner_(main_task_runner),
74 impl_task_runner_(impl_task_runner), 75 impl_task_runner_(impl_task_runner),
75 main_thread_id_(base::PlatformThread::CurrentId()), 76 main_thread_id_(base::PlatformThread::CurrentId()),
76 impl_thread_is_overridden_(false), 77 impl_thread_is_overridden_(false),
77 is_main_thread_blocked_(false) { 78 is_main_thread_blocked_(false) {
78 #endif 79 #endif
79 } 80 }
80 81
81 Proxy::~Proxy() { 82 Proxy::~Proxy() {
82 DCHECK(IsMainThread()); 83 DCHECK(IsMainThread());
83 } 84 }
84 85
85 scoped_ptr<base::Value> Proxy::SchedulerAsValueForTesting() { 86 scoped_ptr<base::Value> Proxy::SchedulerAsValueForTesting() {
86 return make_scoped_ptr(base::Value::CreateNullValue()); 87 return make_scoped_ptr(base::Value::CreateNullValue());
87 } 88 }
88 89
89 } // namespace cc 90 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/proxy.h ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698