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

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

Issue 8769013: Remove BrowserThread::UnsafeGetBrowserThread, add UnsafeGetMessageLoopForThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to lkgr (pure merge). 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') | content/shell/shell_browser_context.cc » ('j') | 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 981eed48344657cad4cbadc60ccaa7d910f9579e..743bec6e550a829b0686297db9b410d465d3499c 100644
--- a/content/public/browser/browser_thread.h
+++ b/content/public/browser/browser_thread.h
@@ -177,39 +177,15 @@ class CONTENT_EXPORT BrowserThread {
static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxyForThread(
ID identifier);
- // Gets the Thread object for the specified thread, or NULL if the
- // thread has not been created (or has been destroyed during
- // shutdown).
+ // Returns a pointer to the thread's message loop, which will become
+ // invalid during shutdown, so you probably shouldn't hold onto it.
//
- // 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).
+ // This must not be called before the thread is started, or after
+ // the thread is stopped, or it will DCHECK.
//
- // 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 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);
+ // Ownership remains with the BrowserThread implementation, so you
+ // must not delete the pointer.
+ static MessageLoop* UnsafeGetMessageLoopForThread(ID identifier);
// Sets the delegate for the specified BrowserThread.
//
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698