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

Unified Diff: content/browser/browser_main_loop.h

Issue 19957002: Run the later parts of startup as UI thread tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run the later parts of startup as UI thread tasks - Jam's nits Created 7 years, 5 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/android/browser_startup_config.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.h
diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h
index 5c3608bc8726bf5abce42176d91435765fcd2c2c..7b2879f70e469d2f4db7a31e60dd6f744a62cceb 100644
--- a/content/browser/browser_main_loop.h
+++ b/content/browser/browser_main_loop.h
@@ -6,8 +6,10 @@
#define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/browser/browser_process_sub_thread.h"
+#include "content/public/browser/browser_main_runner.h"
class CommandLine;
@@ -65,8 +67,8 @@ class CONTENT_EXPORT BrowserMainLoop {
void InitializeToolkit();
void MainMessageLoopStart();
- // Create all secondary threads.
- void CreateThreads();
+ // Create the tasks we need to complete startup.
+ void CreateStartupTasks();
// Perform the default message loop run logic.
void RunMainMessageLoopParts();
@@ -94,8 +96,16 @@ class CONTENT_EXPORT BrowserMainLoop {
void InitializeMainThread();
+ // Called just before creating the threads
+ int PreCreateThreads();
+
+ // Create all secondary threads.
+ int CreateThreads();
+
// Called right after the browser threads have been started.
- void BrowserThreadsStarted();
+ int BrowserThreadsStarted();
+
+ int PreMainMessageLoopRun();
void MainMessageLoopRun();
@@ -103,6 +113,8 @@ class CONTENT_EXPORT BrowserMainLoop {
const MainFunctionParams& parameters_;
const CommandLine& parsed_command_line_;
int result_code_;
+ // True if the non-UI threads were created.
+ bool created_threads_;
// Members initialized in |MainMessageLoopStart()| ---------------------------
scoped_ptr<base::MessageLoop> main_message_loop_;
« no previous file with comments | « content/browser/android/browser_startup_config.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698