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

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

Issue 500123003: Remove implicit conversions from scoped_refptr to T* in cc/trees/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 4 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 | « no previous file | cc/trees/layer_tree_host.cc » ('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/trees/blocking_task_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 24 matching lines...) Expand all
35 35
36 for (size_t i = 0; i < task_runners->runners.size(); ++i) { 36 for (size_t i = 0; i < task_runners->runners.size(); ++i) {
37 if (task_runners->runners[i]->thread_id_ == thread_id) { 37 if (task_runners->runners[i]->thread_id_ == thread_id) {
38 current_task_runner = task_runners->runners[i]; 38 current_task_runner = task_runners->runners[i];
39 } else if (task_runners->runners[i]->HasOneRef()) { 39 } else if (task_runners->runners[i]->HasOneRef()) {
40 task_runners->runners.erase(task_runners->runners.begin() + i); 40 task_runners->runners.erase(task_runners->runners.begin() + i);
41 i--; 41 i--;
42 } 42 }
43 } 43 }
44 44
45 if (current_task_runner) 45 if (current_task_runner.get())
46 return current_task_runner; 46 return current_task_runner;
47 47
48 scoped_refptr<BlockingTaskRunner> runner = 48 scoped_refptr<BlockingTaskRunner> runner =
49 new BlockingTaskRunner(base::MessageLoopProxy::current()); 49 new BlockingTaskRunner(base::MessageLoopProxy::current());
50 task_runners->runners.push_back(runner); 50 task_runners->runners.push_back(runner);
51 return runner; 51 return runner;
52 } 52 }
53 53
54 BlockingTaskRunner::BlockingTaskRunner( 54 BlockingTaskRunner::BlockingTaskRunner(
55 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 55 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 BlockingTaskRunner::CapturePostTasks::CapturePostTasks() 97 BlockingTaskRunner::CapturePostTasks::CapturePostTasks()
98 : blocking_runner_(BlockingTaskRunner::current()) { 98 : blocking_runner_(BlockingTaskRunner::current()) {
99 blocking_runner_->SetCapture(true); 99 blocking_runner_->SetCapture(true);
100 } 100 }
101 101
102 BlockingTaskRunner::CapturePostTasks::~CapturePostTasks() { 102 BlockingTaskRunner::CapturePostTasks::~CapturePostTasks() {
103 blocking_runner_->SetCapture(false); 103 blocking_runner_->SetCapture(false);
104 } 104 }
105 105
106 } // namespace cc 106 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698