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

Side by Side Diff: content/child/worker_task_runner.cc

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/worker_task_runner.h" 5 #include "content/child/worker_task_runner.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 21 matching lines...) Expand all
32 return false; 32 return false;
33 } 33 }
34 34
35 bool RunsTasksOnCurrentThread() const override { return false; } 35 bool RunsTasksOnCurrentThread() const override { return false; }
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 struct WorkerTaskRunner::ThreadLocalState { 40 struct WorkerTaskRunner::ThreadLocalState {
41 ThreadLocalState() {} 41 ThreadLocalState() {}
42 ObserverList<WorkerTaskRunner::Observer> stop_observers_; 42 base::ObserverList<WorkerTaskRunner::Observer> stop_observers_;
43 }; 43 };
44 44
45 WorkerTaskRunner::WorkerTaskRunner() 45 WorkerTaskRunner::WorkerTaskRunner()
46 : task_runner_for_dead_worker_(new DoNothingTaskRunner()) { 46 : task_runner_for_dead_worker_(new DoNothingTaskRunner()) {
47 } 47 }
48 48
49 bool WorkerTaskRunner::PostTask( 49 bool WorkerTaskRunner::PostTask(
50 int id, const base::Closure& closure) { 50 int id, const base::Closure& closure) {
51 DCHECK(id > 0); 51 DCHECK(id > 0);
52 base::AutoLock locker(task_runner_map_lock_); 52 base::AutoLock locker(task_runner_map_lock_);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 current_tls_.Set(NULL); 111 current_tls_.Set(NULL);
112 } 112 }
113 113
114 base::TaskRunner* WorkerTaskRunner::GetTaskRunnerFor(int worker_id) { 114 base::TaskRunner* WorkerTaskRunner::GetTaskRunnerFor(int worker_id) {
115 base::AutoLock locker(task_runner_map_lock_); 115 base::AutoLock locker(task_runner_map_lock_);
116 return ContainsKey(task_runner_map_, worker_id) ? task_runner_map_[worker_id] 116 return ContainsKey(task_runner_map_, worker_id) ? task_runner_map_[worker_id]
117 : task_runner_for_dead_worker_.get(); 117 : task_runner_for_dead_worker_.get();
118 } 118 }
119 119
120 } // namespace content 120 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/gpu/client/command_buffer_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698