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

Unified Diff: chrome/browser/chrome_thread.cc

Issue 149238: Change the lifetime of the WebKit thread to be a subset of the IO thread's li... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/chrome_thread.h ('k') | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_thread.cc
===================================================================
--- chrome/browser/chrome_thread.cc (revision 20100)
+++ chrome/browser/chrome_thread.cc (working copy)
@@ -9,6 +9,7 @@
"Chrome_IOThread", // IO
"Chrome_FileThread", // FILE
"Chrome_DBThread", // DB
+ "Chrome_WebKitThread", // WEBKIT
"Chrome_HistoryThread", // HISTORY
#if defined(OS_LINUX)
"Chrome_Background_X11Thread", // BACKGROUND_X11
@@ -21,6 +22,7 @@
NULL, // IO
NULL, // FILE
NULL, // DB
+ NULL, // WEBKIT
NULL, // HISTORY
#if defined(OS_LINUX)
NULL, // BACKGROUND_X11
@@ -51,3 +53,13 @@
return NULL;
}
+
+// static
+bool ChromeThread::CurrentlyOn(ID identifier) {
+ // MessageLoop::current() will return NULL if none is running. This is often
+ // true when running under unit tests. This behavior actually works out
+ // pretty convienently (as is mentioned in the header file comment), but it's
+ // worth noting here.
+ MessageLoop* message_loop = GetMessageLoop(identifier);
+ return MessageLoop::current() == message_loop;
+}
« no previous file with comments | « chrome/browser/chrome_thread.h ('k') | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698