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

Unified Diff: chrome/browser/in_process_webkit/webkit_thread.h

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 2 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
Index: chrome/browser/in_process_webkit/webkit_thread.h
===================================================================
--- chrome/browser/in_process_webkit/webkit_thread.h (revision 30037)
+++ chrome/browser/in_process_webkit/webkit_thread.h (working copy)
@@ -18,32 +18,17 @@
// process. It should be instantiated and destroyed on the UI thread
// before/after the IO thread is created/destroyed. All other usage should be
// on the IO thread. If the browser is being run in --single-process mode, a
-// thread will never be spun up, and GetMessageLoop() will always return NULL.
+// thread will never be spun up.
class WebKitThread {
public:
// Called from the UI thread.
WebKitThread();
~WebKitThread();
- // Returns the message loop for the WebKit thread unless we're in
- // --single-processuntil mode, in which case it'll return NULL. Only call
+ // Creates the WebKit thread if it hasn't been already created. Only call
// from the IO thread. Only do fast-path work here.
- MessageLoop* GetMessageLoop() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- if (!webkit_thread_.get())
- return InitializeThread();
- return webkit_thread_->message_loop();
- }
+ void EnsureInitialized();
- // Called from the IO thread. Notifies us that it's no longer safe to post
- // tasks to the IO thread.
- void Shutdown();
-
- // Post a task to the IO thread if we haven't yet been told to shut down.
- // Only call from the WebKit thread.
- bool PostIOThreadTask(const tracked_objects::Location& from_here,
- Task* task);
-
private:
// Must be private so that we can carefully control its lifetime.
class InternalWebKitThread : public ChromeThread {
@@ -68,11 +53,6 @@
// from the IO thread while the WebKit thread is not running.
scoped_ptr<InternalWebKitThread> webkit_thread_;
- // A pointer to the IO message loop. This is nulled out when Shutdown() is
- // called. Only access under the io_message_loop_lock_.
- MessageLoop* io_message_loop_;
- Lock io_message_loop_lock_;
-
DISALLOW_COPY_AND_ASSIGN(WebKitThread);
};

Powered by Google App Engine
This is Rietveld 408576698