summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
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/renderer_host
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/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.h5
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc11
2 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h
index 333791e..9a19249 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.h
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.h
@@ -292,7 +292,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
}
WebKitThread* webkit_thread() const {
- return webkit_thread_;
+ return webkit_thread_.get();
}
MessageLoop* ui_loop() const { return ui_loop_; }
@@ -529,7 +529,8 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
scoped_refptr<SafeBrowsingService> safe_browsing_;
- scoped_refptr<WebKitThread> webkit_thread_;
+ // We own the WebKit thread and see to its destruction.
+ scoped_ptr<WebKitThread> webkit_thread_;
// Request ID for browser initiated requests. request_ids generated by
// child processes are counted up from 0, while browser created requests
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index f4168da..f9b535e 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -175,10 +175,7 @@ ResourceMessageFilter::ResourceMessageFilter(
ResourceMessageFilter::~ResourceMessageFilter() {
// This function should be called on the IO thread.
- DCHECK(MessageLoop::current() ==
- ChromeThread::GetMessageLoop(ChromeThread::IO));
-
- dom_storage_dispatcher_host_->Shutdown();
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
// Let interested observers know we are being deleted.
NotificationService::current()->Notify(
@@ -452,8 +449,7 @@ void ResourceMessageFilter::OnGetDataDir(std::wstring* data_dir) {
void ResourceMessageFilter::OnPluginMessage(const FilePath& plugin_path,
const std::vector<uint8>& data) {
- DCHECK(MessageLoop::current() ==
- ChromeThread::GetMessageLoop(ChromeThread::IO));
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
ChromePluginLib *chrome_plugin = ChromePluginLib::Find(plugin_path);
if (chrome_plugin) {
@@ -466,8 +462,7 @@ void ResourceMessageFilter::OnPluginMessage(const FilePath& plugin_path,
void ResourceMessageFilter::OnPluginSyncMessage(const FilePath& plugin_path,
const std::vector<uint8>& data,
std::vector<uint8> *retval) {
- DCHECK(MessageLoop::current() ==
- ChromeThread::GetMessageLoop(ChromeThread::IO));
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
ChromePluginLib *chrome_plugin = ChromePluginLib::Find(plugin_path);
if (chrome_plugin) {