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

Side by Side Diff: chromecast/base/alarm_manager.cc

Issue 2884763002: Automated IWYU fix for TaskRunner includes. (Closed)
Patch Set: rebase on r472096 Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chromecast/base/alarm_manager.h" 5 #include "chromecast/base/alarm_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/single_thread_task_runner.h"
8 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
9 #include "base/time/default_clock.h" 10 #include "base/time/default_clock.h"
10 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
11 12
12 #define MAKE_SURE_OWN_THREAD(callback, ...) \ 13 #define MAKE_SURE_OWN_THREAD(callback, ...) \
13 if (!task_runner_->BelongsToCurrentThread()) { \ 14 if (!task_runner_->BelongsToCurrentThread()) { \
14 task_runner_->PostTask( \ 15 task_runner_->PostTask( \
15 FROM_HERE, base::Bind(&AlarmManager::callback, \ 16 FROM_HERE, base::Bind(&AlarmManager::callback, \
16 weak_factory_.GetWeakPtr(), ##__VA_ARGS__)); \ 17 weak_factory_.GetWeakPtr(), ##__VA_ARGS__)); \
17 return; \ 18 return; \
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::Time now = clock_->Now(); 84 base::Time now = clock_->Now();
84 // Fire appropriate alarms. 85 // Fire appropriate alarms.
85 while ((!next_alarm_.empty()) && now >= next_alarm_.top()->time()) { 86 while ((!next_alarm_.empty()) && now >= next_alarm_.top()->time()) {
86 next_alarm_.top()->task_runner()->PostTask(FROM_HERE, 87 next_alarm_.top()->task_runner()->PostTask(FROM_HERE,
87 next_alarm_.top()->task()); 88 next_alarm_.top()->task());
88 next_alarm_.pop(); 89 next_alarm_.pop();
89 } 90 }
90 } 91 }
91 92
92 } // namespace chromecast 93 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/server/http_handler.cc ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698