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

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

Issue 8775014: Remove IOThread::message_loop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years 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_thread_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/browser_thread.h
diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h
index 71d7472a2837b8070b1edbcbf2b36fb80d8e5d2f..986268409c47f0106cea20a393306c55d6c75e46 100644
--- a/content/public/browser/browser_thread.h
+++ b/content/public/browser/browser_thread.h
@@ -17,6 +17,8 @@
#include "base/logging.h"
#endif // UNIT_TEST
+class MessageLoop;
+
namespace base {
class MessageLoopProxy;
class Thread;
@@ -179,8 +181,8 @@ class CONTENT_EXPORT BrowserThread {
// with a command-line that would specify a browser process (e.g. an
// empty command line).
//
- // This is unsafe as your pointer may become invalid close to
- // shutdown.
+ // It is unsafe to store this pointer as it may become invalid close
+ // to shutdown.
//
// TODO(joi): Remove this once clients such as BrowserProcessImpl
// (and classes that call things like
@@ -188,6 +190,23 @@ class CONTENT_EXPORT BrowserThread {
// MessageLoopProxy.
static base::Thread* UnsafeGetBrowserThread(ID identifier);
+ // Gets the MessageLoop for the specified thread, or NULL if the
+ // thread has not been created (or has been destroyed during
+ // shutdown).
+ //
+ // Before calling this, you must have called content::ContentMain
+ // with a command-line that would specify a browser process (e.g. an
+ // empty command line).
+ //
+ // It is unsafe to store this pointer as it may become invalid close
+ // to shutdown.
+ //
+ // TODO(joi): Remove this once clients such as BrowserProcessImpl
+ // (and classes that call things like
+ // g_browser_process->file_thread()) are switched to using
+ // MessageLoopProxy.
+ static MessageLoop* UnsafeGetMessageLoop(ID identifier);
+
// Sets the delegate for the specified BrowserThread.
//
// Only one delegate may be registered at a time. Delegates may be
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698