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

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

Issue 485043003: cc: Use correct message loop proxy in BlockingTaskRunner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Help gn deal with it. Created 6 years, 3 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
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 #include "cc/trees/blocking_task_runner.h"
danakj 2014/08/28 17:10:46 this is already in the .h. can that one be a forwa
Sami 2014/08/28 18:21:17 Oops, fixed.
9 10
10 namespace cc { 11 namespace cc {
11 12
12 base::SingleThreadTaskRunner* Proxy::MainThreadTaskRunner() const { 13 base::SingleThreadTaskRunner* Proxy::MainThreadTaskRunner() const {
13 return main_task_runner_.get(); 14 return main_task_runner_.get();
14 } 15 }
15 16
16 bool Proxy::HasImplThread() const { return !!impl_task_runner_.get(); } 17 bool Proxy::HasImplThread() const { return !!impl_task_runner_.get(); }
17 18
18 base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const { 19 base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 63
63 #if DCHECK_IS_ON 64 #if DCHECK_IS_ON
64 void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) { 65 void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) {
65 is_main_thread_blocked_ = is_main_thread_blocked; 66 is_main_thread_blocked_ = is_main_thread_blocked;
66 } 67 }
67 #endif 68 #endif
68 69
69 Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 70 Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
70 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) 71 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
71 #if !DCHECK_IS_ON 72 #if !DCHECK_IS_ON
72 : main_task_runner_(main_task_runner), impl_task_runner_(impl_task_runner) { 73 : main_task_runner_(main_task_runner),
74 impl_task_runner_(impl_task_runner),
75 blocking_main_thread_task_runner_(
76 BlockingTaskRunner::Create(main_task_runner)) {
73 #else 77 #else
74 : main_task_runner_(main_task_runner), 78 : main_task_runner_(main_task_runner),
75 impl_task_runner_(impl_task_runner), 79 impl_task_runner_(impl_task_runner),
80 blocking_main_thread_task_runner_(
81 BlockingTaskRunner::Create(main_task_runner)),
76 main_thread_id_(base::PlatformThread::CurrentId()), 82 main_thread_id_(base::PlatformThread::CurrentId()),
77 impl_thread_is_overridden_(false), 83 impl_thread_is_overridden_(false),
78 is_main_thread_blocked_(false) { 84 is_main_thread_blocked_(false) {
79 #endif 85 #endif
80 } 86 }
81 87
82 Proxy::~Proxy() { 88 Proxy::~Proxy() {
83 DCHECK(IsMainThread()); 89 DCHECK(IsMainThread());
84 } 90 }
85 91
86 } // namespace cc 92 } // namespace cc
OLDNEW
« cc/trees/proxy.h ('K') | « cc/trees/proxy.h ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698