summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_thread.cc
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 01:05:18 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 01:05:18 +0000
commit0e0b9771cc4fe496403a49126ec7cfa6c422a6d0 (patch)
treece10c712de9d295dfe9457f0fa065806d6c5abb5 /chrome/browser/chrome_thread.cc
parente90355370c3763d71fb0f6346f08ef1b3246fa58 (diff)
downloadchromium_src-0e0b9771cc4fe496403a49126ec7cfa6c422a6d0.zip
chromium_src-0e0b9771cc4fe496403a49126ec7cfa6c422a6d0.tar.gz
chromium_src-0e0b9771cc4fe496403a49126ec7cfa6c422a6d0.tar.bz2
Simplify the WebKit thread model. It's now created/destroyed on the UI thread (before/after the IO thread is started/stopped). The WebKit thread is created lazily as needed (while on the IO thread).TEST=noneBUG=none
Review URL: http://codereview.chromium.org/149238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_thread.cc')
-rw-r--r--chrome/browser/chrome_thread.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/chrome_thread.cc b/chrome/browser/chrome_thread.cc
index 762ae76..4ef8480 100644
--- a/chrome/browser/chrome_thread.cc
+++ b/chrome/browser/chrome_thread.cc
@@ -9,6 +9,7 @@ static const char* chrome_thread_names[ChromeThread::ID_COUNT] = {
"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 @@ ChromeThread* ChromeThread::chrome_threads_[ID_COUNT] = {
NULL, // IO
NULL, // FILE
NULL, // DB
+ NULL, // WEBKIT
NULL, // HISTORY
#if defined(OS_LINUX)
NULL, // BACKGROUND_X11
@@ -51,3 +53,13 @@ MessageLoop* ChromeThread::GetMessageLoop(ID identifier) {
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;
+}