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

Unified Diff: content/browser/startup_task_runner.h

Issue 22691002: Allow overlapping sync and async startup requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow overlapping sync and async startup requests - fix code review Nits Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | content/browser/startup_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/startup_task_runner.h
diff --git a/content/browser/startup_task_runner.h b/content/browser/startup_task_runner.h
index 5f954edc8879cc2731cb13038dc35a663809843b..80e5627803f38144c3bf616e54607239172987f3 100644
--- a/content/browser/startup_task_runner.h
+++ b/content/browser/startup_task_runner.h
@@ -8,7 +8,6 @@
#include <list>
#include "base/callback.h"
-#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
@@ -32,30 +31,31 @@ typedef base::Callback<int(void)> StartupTask;
// no opportunity to handle UI events between the tasks of a
// SingleThreadedTaskRunner.
-class CONTENT_EXPORT StartupTaskRunner
- : public base::RefCounted<StartupTaskRunner> {
+class CONTENT_EXPORT StartupTaskRunner {
public:
// Constructor: Note that |startup_complete_callback| is optional. If it is
// not null it will be called once all the startup tasks have run.
- StartupTaskRunner(bool browser_may_start_asynchronously,
- base::Callback<void(int)> startup_complete_callback,
+ StartupTaskRunner(base::Callback<void(int)> startup_complete_callback,
scoped_refptr<base::SingleThreadTaskRunner> proxy);
+ ~StartupTaskRunner();
+
// Add a task to the queue of startup tasks to be run.
- virtual void AddTask(StartupTask& callback);
+ void AddTask(StartupTask& callback);
+
+ // Start running the tasks asynchronously.
+ void StartRunningTasksAsync();
- // Start running the tasks.
- virtual void StartRunningTasks();
+ // Run all tasks, or all remaining tasks, synchronously
+ void RunAllTasksNow();
private:
friend class base::RefCounted<StartupTaskRunner>;
- virtual ~StartupTaskRunner();
std::list<StartupTask> task_list_;
void WrappedTask();
- const bool asynchronous_startup_;
base::Callback<void(int)> startup_complete_callback_;
scoped_refptr<base::SingleThreadTaskRunner> proxy_;
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | content/browser/startup_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698