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

Side by Side Diff: chrome/browser/after_startup_task_utils.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase & remove inline keyword 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/after_startup_task_utils.h" 5 #include "chrome/browser/after_startup_task_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 bool AfterStartupTaskUtils::Runner::PostDelayedTask( 210 bool AfterStartupTaskUtils::Runner::PostDelayedTask(
211 const tracked_objects::Location& from_here, 211 const tracked_objects::Location& from_here,
212 base::OnceClosure task, 212 base::OnceClosure task,
213 base::TimeDelta delay) { 213 base::TimeDelta delay) {
214 DCHECK(delay.is_zero()); 214 DCHECK(delay.is_zero());
215 AfterStartupTaskUtils::PostTask(from_here, destination_runner_, 215 AfterStartupTaskUtils::PostTask(from_here, destination_runner_,
216 std::move(task)); 216 std::move(task));
217 return true; 217 return true;
218 } 218 }
219 219
220 bool AfterStartupTaskUtils::Runner::RunsTasksOnCurrentThread() const { 220 bool AfterStartupTaskUtils::Runner::RunsTasksInCurrentSequence() const {
221 return destination_runner_->RunsTasksOnCurrentThread(); 221 return destination_runner_->RunsTasksInCurrentSequence();
222 } 222 }
223 223
224 void AfterStartupTaskUtils::StartMonitoringStartup() { 224 void AfterStartupTaskUtils::StartMonitoringStartup() {
225 // The observer is self-deleting. 225 // The observer is self-deleting.
226 (new StartupObserver)->Start(); 226 (new StartupObserver)->Start();
227 } 227 }
228 228
229 void AfterStartupTaskUtils::PostTask( 229 void AfterStartupTaskUtils::PostTask(
230 const tracked_objects::Location& from_here, 230 const tracked_objects::Location& from_here,
231 const scoped_refptr<base::TaskRunner>& destination_runner, 231 const scoped_refptr<base::TaskRunner>& destination_runner,
(...skipping 20 matching lines...) Expand all
252 return ::IsBrowserStartupComplete(); 252 return ::IsBrowserStartupComplete();
253 } 253 }
254 254
255 void AfterStartupTaskUtils::UnsafeResetForTesting() { 255 void AfterStartupTaskUtils::UnsafeResetForTesting() {
256 DCHECK(g_after_startup_tasks.Get().empty()); 256 DCHECK(g_after_startup_tasks.Get().empty());
257 if (!IsBrowserStartupComplete()) 257 if (!IsBrowserStartupComplete())
258 return; 258 return;
259 g_startup_complete_flag.Get().UnsafeResetForTesting(); 259 g_startup_complete_flag.Get().UnsafeResetForTesting();
260 DCHECK(!IsBrowserStartupComplete()); 260 DCHECK(!IsBrowserStartupComplete());
261 } 261 }
OLDNEW
« no previous file with comments | « chrome/browser/after_startup_task_utils.h ('k') | chrome/browser/after_startup_task_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698