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

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

Issue 405007: Always start the WebKit thread.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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/in_process_webkit/webkit_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/in_process_webkit/webkit_thread.cc
===================================================================
--- chrome/browser/in_process_webkit/webkit_thread.cc (revision 32167)
+++ chrome/browser/in_process_webkit/webkit_thread.cc (working copy)
@@ -9,9 +9,17 @@
#include "chrome/common/chrome_switches.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
-// This happens on the UI thread before the IO thread has been shut down.
+// This happens on the UI thread.
WebKitThread::WebKitThread() {
- // The thread is started lazily by InitializeThread() on the IO thread.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) {
+ // TODO(jorlow): This thread should be used (and started) in single process
+ // mode rather than following different code paths.
+ return;
+ }
+
+ webkit_thread_.reset(new InternalWebKitThread);
+ bool started = webkit_thread_->Start();
+ DCHECK(started);
}
// This happens on the UI thread after the IO thread has been shut down.
@@ -23,13 +31,6 @@
DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
}
-void WebKitThread::EnsureInitialized() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- if (webkit_thread_.get())
- return;
- InitializeThread();
-}
-
WebKitThread::InternalWebKitThread::InternalWebKitThread()
: ChromeThread(ChromeThread::WEBKIT) {
}
@@ -43,21 +44,10 @@
webkit_client_.reset(new BrowserWebKitClientImpl);
WebKit::initialize(webkit_client_.get());
// If possible, post initialization tasks to this thread (rather than doing
- // them now) so we don't block the IO thread any longer than we have to.
+ // them now) so we don't block the UI thread any longer than we have to.
}
void WebKitThread::InternalWebKitThread::CleanUp() {
DCHECK(webkit_client_.get());
WebKit::shutdown();
}
-
-MessageLoop* WebKitThread::InitializeThread() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess))
- return NULL;
-
- DCHECK(!webkit_thread_.get());
- webkit_thread_.reset(new InternalWebKitThread);
- bool started = webkit_thread_->Start();
- DCHECK(started);
- return webkit_thread_->message_loop();
-}
« no previous file with comments | « chrome/browser/in_process_webkit/webkit_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698