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

Side by Side Diff: cc/base/blocking_task_runner.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « cc/base/blocking_task_runner.h ('k') | cc/base/cc_export.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/blocking_task_runner.h" 5 #include "cc/base/blocking_task_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop/message_loop_proxy.h" 11 #include "base/message_loop/message_loop_proxy.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 // static 15 // static
16 scoped_ptr<BlockingTaskRunner> BlockingTaskRunner::Create( 16 scoped_ptr<BlockingTaskRunner> BlockingTaskRunner::Create(
17 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 17 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
18 return make_scoped_ptr(new BlockingTaskRunner(task_runner)); 18 return make_scoped_ptr(new BlockingTaskRunner(task_runner));
19 } 19 }
20 20
21 BlockingTaskRunner::BlockingTaskRunner( 21 BlockingTaskRunner::BlockingTaskRunner(
22 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 22 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
23 : thread_id_(base::PlatformThread::CurrentId()), 23 : thread_id_(base::PlatformThread::CurrentId()),
24 task_runner_(task_runner), 24 task_runner_(task_runner),
25 capture_(0) { 25 capture_(0) {
26 } 26 }
27 27
28 BlockingTaskRunner::~BlockingTaskRunner() {} 28 BlockingTaskRunner::~BlockingTaskRunner() {
29 }
29 30
30 bool BlockingTaskRunner::BelongsToCurrentThread() { 31 bool BlockingTaskRunner::BelongsToCurrentThread() {
31 return base::PlatformThread::CurrentId() == thread_id_; 32 return base::PlatformThread::CurrentId() == thread_id_;
32 } 33 }
33 34
34 bool BlockingTaskRunner::PostTask(const tracked_objects::Location& from_here, 35 bool BlockingTaskRunner::PostTask(const tracked_objects::Location& from_here,
35 const base::Closure& task) { 36 const base::Closure& task) {
36 base::AutoLock lock(lock_); 37 base::AutoLock lock(lock_);
37 DCHECK(task_runner_.get() || capture_); 38 DCHECK(task_runner_.get() || capture_);
38 if (!capture_) 39 if (!capture_)
(...skipping 26 matching lines...) Expand all
65 BlockingTaskRunner* blocking_runner) 66 BlockingTaskRunner* blocking_runner)
66 : blocking_runner_(blocking_runner) { 67 : blocking_runner_(blocking_runner) {
67 blocking_runner_->SetCapture(true); 68 blocking_runner_->SetCapture(true);
68 } 69 }
69 70
70 BlockingTaskRunner::CapturePostTasks::~CapturePostTasks() { 71 BlockingTaskRunner::CapturePostTasks::~CapturePostTasks() {
71 blocking_runner_->SetCapture(false); 72 blocking_runner_->SetCapture(false);
72 } 73 }
73 74
74 } // namespace cc 75 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/blocking_task_runner.h ('k') | cc/base/cc_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698