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

Unified Diff: content/public/browser/browser_main_parts.h

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More IWYU, missing link-time dependency for Chrome Frame. Created 9 years, 1 month 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
Index: content/public/browser/browser_main_parts.h
diff --git a/content/public/browser/browser_main_parts.h b/content/public/browser/browser_main_parts.h
index 0bbaa835d3e050582058e4ce4fc8992a420b124b..88d39560672d66cd6710d6f32ab17f9b02b39f26 100644
--- a/content/public/browser/browser_main_parts.h
+++ b/content/public/browser/browser_main_parts.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "content/common/content_export.h"
+#include "content/public/browser/browser_thread.h"
namespace content {
@@ -68,16 +69,32 @@ class CONTENT_EXPORT BrowserMainParts {
virtual void PostMainMessageLoopStart() = 0;
+ // Child threads have not been created at this point.
virtual void PreMainMessageLoopRun() = 0;
+ // The various browser threads have been created at this point.
+ virtual void PreMainMessageLoopRunThreadsCreated() = 0;
+
// Returns true if the message loop was run, false otherwise.
// May set |result_code|, which will be returned by |BrowserMain()|.
// If no BrowserMainParts implementations return true, the default
// implementation will be run.
virtual bool MainMessageLoopRun(int* result_code) = 0;
+ // This happens after the main message loop has stopped, but before
+ // threads are stopped.
virtual void PostMainMessageLoopRun() = 0;
+ // Called once for each thread owned by the content framework just
+ // before and just after it is torn down. This is in reverse order
+ // of the threads' appearance in the BrowserThread::ID enumeration,
+ // i.e. the BrowserThread::DB thread goes last.
jam 2011/11/07 21:43:24 nit: personally i'd leave out line 91, since that
Jói 2011/11/18 23:21:44 Good point. Changed to what I was really thinking
+ virtual void PreStopThread(BrowserThread::ID identifier) = 0;
+ virtual void PostStopThread(BrowserThread::ID identifier) = 0;
+
+ // Called as the very last part of shutdown.
+ virtual void FinalCleanup() = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
};

Powered by Google App Engine
This is Rietveld 408576698