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

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

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « base/synchronization/cancellation_flag.cc ('k') | chrome/browser/after_startup_task_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_
6 #define CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_
7
8 #include "base/basictypes.h"
9 #include "base/bind.h"
10 #include "base/gtest_prod_util.h"
11 #include "base/memory/ref_counted.h"
12
13 namespace base {
14 class TaskRunner;
15 }
16 namespace tracked_objects {
17 class Location;
18 };
19
20 class AfterStartupTaskUtils {
21 public:
22 // Observes startup and when complete runs tasks that have accrued.
23 static void StartMonitoringStartup();
24
25 // Used to augment the behavior of BrowserThread::PostAfterStartupTask
26 // for chrome. Tasks are queued until startup is complete.
27 // Note: see browser_thread.h
28 static void PostTask(const tracked_objects::Location& from_here,
29 const scoped_refptr<base::TaskRunner>& task_runner,
30 const base::Closure& task);
31
32 private:
33 friend class AfterStartupTaskTest;
34 FRIEND_TEST_ALL_PREFIXES(AfterStartupTaskTest, IsStartupComplete);
35 FRIEND_TEST_ALL_PREFIXES(AfterStartupTaskTest, PostTask);
36
37 static bool IsBrowserStartupComplete();
38 static void SetBrowserStartupIsComplete();
39 static void UnsafeResetForTesting();
40
41 DISALLOW_IMPLICIT_CONSTRUCTORS(AfterStartupTaskUtils);
42 };
43
44 #endif // CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_
OLDNEW
« no previous file with comments | « base/synchronization/cancellation_flag.cc ('k') | chrome/browser/after_startup_task_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698