| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ | 5 #ifndef CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ |
| 6 #define CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ | 6 #define CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // AfterStartupTaskUtils::PostTask(). Doesn't support tasks with a non-zero | 21 // AfterStartupTaskUtils::PostTask(). Doesn't support tasks with a non-zero |
| 22 // delay. | 22 // delay. |
| 23 class Runner : public base::TaskRunner { | 23 class Runner : public base::TaskRunner { |
| 24 public: | 24 public: |
| 25 explicit Runner(scoped_refptr<base::TaskRunner> destination_runner); | 25 explicit Runner(scoped_refptr<base::TaskRunner> destination_runner); |
| 26 | 26 |
| 27 // Overrides from base::TaskRunner: | 27 // Overrides from base::TaskRunner: |
| 28 bool PostDelayedTask(const tracked_objects::Location& from_here, | 28 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 29 base::OnceClosure task, | 29 base::OnceClosure task, |
| 30 base::TimeDelta delay) override; | 30 base::TimeDelta delay) override; |
| 31 bool RunsTasksOnCurrentThread() const override; | 31 bool RunsTasksInCurrentSequence() const override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 ~Runner() override; | 34 ~Runner() override; |
| 35 | 35 |
| 36 const scoped_refptr<base::TaskRunner> destination_runner_; | 36 const scoped_refptr<base::TaskRunner> destination_runner_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(Runner); | 38 DISALLOW_COPY_AND_ASSIGN(Runner); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // Observes startup and when complete runs tasks that have accrued. | 41 // Observes startup and when complete runs tasks that have accrued. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 65 // SetBrowserStartupIsComplete() directly. Ideally it would use | 65 // SetBrowserStartupIsComplete() directly. Ideally it would use |
| 66 // StartMonitoringStartup() as the normal approach. | 66 // StartMonitoringStartup() as the normal approach. |
| 67 friend class android::AfterStartupTaskUtilsJNI; | 67 friend class android::AfterStartupTaskUtilsJNI; |
| 68 | 68 |
| 69 static void SetBrowserStartupIsComplete(); | 69 static void SetBrowserStartupIsComplete(); |
| 70 | 70 |
| 71 DISALLOW_IMPLICIT_CONSTRUCTORS(AfterStartupTaskUtils); | 71 DISALLOW_IMPLICIT_CONSTRUCTORS(AfterStartupTaskUtils); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 #endif // CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ | 74 #endif // CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_ |
| OLD | NEW |