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

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: Fix official build, avoid DCHECK in official Linux/ChromeOS builds. 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/browser_shutdown.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 860541c4e14f6905585e9a2afc56634ca21983bc..4bce3cf45db7b6513c8f7710f030ef22732239c1 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 {
@@ -64,6 +65,24 @@ class CONTENT_EXPORT BrowserMainParts {
// Allows an embedder to do any extra toolkit initialization.
virtual void ToolkitInitialized() = 0;
+ // Called just before any child threads owned by the content
+ // framework are created.
+ //
+ // The main message loop has been started at this point (but has not
+ // been run), and the toolkit has been initialized.
+ virtual void PreCreateThreads() = 0;
+
+ // Called once for each thread owned by the content framework just
+ // before and just after the thread object is created and started.
+ // This happens in the order of the threads' appearence in the
+ // BrowserThread::ID enumeration. Note that there will be no such
+ // call for BrowserThread::UI, since it is the main thread of the
+ // application.
+ virtual void PreStartThread(BrowserThread::ID identifier) = 0;
+ virtual void PostStartThread(BrowserThread::ID identifier) = 0;
+
+ // This is called just before the main message loop is run. The
+ // various browser threads have all been created at this point
virtual void PreMainMessageLoopRun() = 0;
// Returns true if the message loop was run, false otherwise.
@@ -71,8 +90,22 @@ class CONTENT_EXPORT BrowserMainParts {
// May set |result_code|, which will be returned by |BrowserMain()|.
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.
+ // Note that you will not receive such a call for BrowserThread::UI,
+ // since it is the main thread of the application.
+ virtual void PreStopThread(BrowserThread::ID identifier) = 0;
+ virtual void PostStopThread(BrowserThread::ID identifier) = 0;
+
+ // Called as the very last part of shutdown, after threads have been
+ // stopped and destroyed.
+ virtual void PostDestroyThreads() = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
};
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/browser_shutdown.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698