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

Side by Side Diff: chrome/common/worker_thread_ticker.cc

Issue 6028009: Move base/thread.h to base/threading, fix up callers to use the new location.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/common/worker_thread_ticker.h" 5 #include "chrome/common/worker_thread_ticker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/task.h" 11 #include "base/task.h"
12 #include "base/thread.h" 12 #include "base/threading/thread.h"
13 13
14 class WorkerThreadTicker::TimerTask : public Task { 14 class WorkerThreadTicker::TimerTask : public Task {
15 public: 15 public:
16 explicit TimerTask(WorkerThreadTicker* ticker) : ticker_(ticker) { 16 explicit TimerTask(WorkerThreadTicker* ticker) : ticker_(ticker) {
17 } 17 }
18 18
19 virtual void Run() { 19 virtual void Run() {
20 // When the ticker is running, the handler list CANNOT be modified. 20 // When the ticker is running, the handler list CANNOT be modified.
21 // So we can do the enumeration safely without a lock 21 // So we can do the enumeration safely without a lock
22 TickHandlerListType* handlers = &ticker_->tick_handler_list_; 22 TickHandlerListType* handlers = &ticker_->tick_handler_list_;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return false; 92 return false;
93 is_running_ = false; 93 is_running_ = false;
94 timer_thread_.Stop(); 94 timer_thread_.Stop();
95 return true; 95 return true;
96 } 96 }
97 97
98 void WorkerThreadTicker::ScheduleTimerTask() { 98 void WorkerThreadTicker::ScheduleTimerTask() {
99 timer_thread_.message_loop()->PostDelayedTask(FROM_HERE, new TimerTask(this), 99 timer_thread_.message_loop()->PostDelayedTask(FROM_HERE, new TimerTask(this),
100 tick_interval_); 100 tick_interval_);
101 } 101 }
OLDNEW
« no previous file with comments | « chrome/common/worker_thread_ticker.h ('k') | chrome/default_plugin/plugin_install_job_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698