From 0e0b9771cc4fe496403a49126ec7cfa6c422a6d0 Mon Sep 17 00:00:00 2001 From: "jorlow@chromium.org" Date: Wed, 8 Jul 2009 01:05:18 +0000 Subject: 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 --- chrome/browser/chrome_thread.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'chrome/browser/chrome_thread.h') diff --git a/chrome/browser/chrome_thread.h b/chrome/browser/chrome_thread.h index 1fd1901..4978214 100644 --- a/chrome/browser/chrome_thread.h +++ b/chrome/browser/chrome_thread.h @@ -38,6 +38,10 @@ class ChromeThread : public base::Thread { // This is the thread that interacts with the database. DB, + // This is the "main" thread for WebKit within the browser process when + // NOT in --single-process mode. + WEBKIT, + // This is the thread that interacts with the history database. HISTORY, @@ -68,6 +72,16 @@ class ChromeThread : public base::Thread { // static MessageLoop* GetMessageLoop(ID identifier); + // Callable on any thread. Returns whether you're currently on a particular + // thread. + // + // WARNING: + // When running under unit-tests, this will return true if you're on the + // main thread and the thread ID you pass in isn't running. This is + // normally the correct behavior because you want to ignore these asserts + // unless you've specifically spun up the threads, but be mindful of it. + static bool CurrentlyOn(ID identifier); + private: // The identifier of this thread. Only one thread can exist with a given // identifier at a given time. -- cgit v1.1