summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 22:02:57 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 22:02:57 +0000
commit9cb31511cb8ba57c36157c5a509ffd3fe4568437 (patch)
tree3110acca212c5387d4e0965d371c7a3c207c6871
parent06dbd0779f5a378f33d26526db0f9216c28ff35c (diff)
downloadchromium_src-9cb31511cb8ba57c36157c5a509ffd3fe4568437.zip
chromium_src-9cb31511cb8ba57c36157c5a509ffd3fe4568437.tar.gz
chromium_src-9cb31511cb8ba57c36157c5a509ffd3fe4568437.tar.bz2
Revert 80702 - Remove RDH from UtilityProcessHost.The utility process should not need to issue resource requests.BUG=78596TEST=noneReview URL: http://codereview.chromium.org/6805008
TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/6805020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80703 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_updater.cc2
-rw-r--r--chrome/browser/extensions/extension_webstore_private_api.cc7
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc3
-rw-r--r--chrome/browser/idbbindingutilities_browsertest.cc13
-rw-r--r--chrome/browser/utility_process_host.cc5
-rw-r--r--chrome/browser/utility_process_host.h3
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc8
-rw-r--r--content/browser/in_process_webkit/indexed_db_key_utility_client.cc16
8 files changed, 34 insertions, 23 deletions
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 731d9bf..22af3a1 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -579,7 +579,7 @@ class SafeManifestParser : public UtilityProcessHost::Client {
!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
if (use_utility_process) {
UtilityProcessHost* host = new UtilityProcessHost(
- this, BrowserThread::UI);
+ rdh, this, BrowserThread::UI);
host->StartUpdateManifestParse(xml_);
} else {
UpdateManifest manifest;
diff --git a/chrome/browser/extensions/extension_webstore_private_api.cc b/chrome/browser/extensions/extension_webstore_private_api.cc
index ff8b374..ca7e984 100644
--- a/chrome/browser/extensions/extension_webstore_private_api.cc
+++ b/chrome/browser/extensions/extension_webstore_private_api.cc
@@ -164,12 +164,13 @@ class SafeBeginInstallHelper : public UtilityProcessHost::Client {
BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this,
- &SafeBeginInstallHelper::StartWorkOnIOThread));
+ &SafeBeginInstallHelper::StartWorkOnIOThread,
+ g_browser_process->resource_dispatcher_host()));
}
- void StartWorkOnIOThread() {
+ void StartWorkOnIOThread(ResourceDispatcherHost* rdh) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- utility_host_ = new UtilityProcessHost(this, BrowserThread::IO);
+ utility_host_ = new UtilityProcessHost(rdh, this, BrowserThread::IO);
utility_host_->StartBatchMode();
if (icon_data_.empty())
icon_decode_complete_ = true;
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 6c41707..8b42d5e 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -146,7 +146,8 @@ SandboxedExtensionUnpacker::~SandboxedExtensionUnpacker() {
void SandboxedExtensionUnpacker::StartProcessOnIOThread(
const FilePath& temp_crx_path) {
- UtilityProcessHost* host = new UtilityProcessHost(this, thread_identifier_);
+ UtilityProcessHost* host = new UtilityProcessHost(
+ rdh_, this, thread_identifier_);
host->StartExtensionUnpacker(temp_crx_path);
}
diff --git a/chrome/browser/idbbindingutilities_browsertest.cc b/chrome/browser/idbbindingutilities_browsertest.cc
index aa7a2d7..cf95cb6 100644
--- a/chrome/browser/idbbindingutilities_browsertest.cc
+++ b/chrome/browser/idbbindingutilities_browsertest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -67,16 +67,18 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client {
value_for_key_path_failed_(false) {
}
- void CreateUtilityProcess() {
+ void CreateUtilityProcess(ResourceDispatcherHost* resource_dispatcher_host) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this, &IDBKeyPathHelper::CreateUtilityProcess));
+ NewRunnableMethod(this, &IDBKeyPathHelper::CreateUtilityProcess,
+ resource_dispatcher_host));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
utility_process_host_ =
- new UtilityProcessHost(this, BrowserThread::IO);
+ new UtilityProcessHost(resource_dispatcher_host, this,
+ BrowserThread::IO);
utility_process_host_->StartBatchMode();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
new MessageLoop::QuitTask());
@@ -191,7 +193,8 @@ class ScopedIDBKeyPathHelper {
public:
ScopedIDBKeyPathHelper() {
key_path_helper_ = new IDBKeyPathHelper();
- key_path_helper_->CreateUtilityProcess();
+ key_path_helper_->CreateUtilityProcess(
+ g_browser_process->resource_dispatcher_host());
ui_test_utils::RunMessageLoop();
}
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index 5669ec0..888da1e 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -17,9 +17,10 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/ui_base_switches.h"
-UtilityProcessHost::UtilityProcessHost(Client* client,
+UtilityProcessHost::UtilityProcessHost(ResourceDispatcherHost* rdh,
+ Client* client,
BrowserThread::ID client_thread_id)
- : BrowserChildProcessHost(UTILITY_PROCESS, NULL),
+ : BrowserChildProcessHost(UTILITY_PROCESS, rdh),
client_(client),
client_thread_id_(client_thread_id),
is_batch_mode_(false) {
diff --git a/chrome/browser/utility_process_host.h b/chrome/browser/utility_process_host.h
index b8c8cff..fa8a9c6 100644
--- a/chrome/browser/utility_process_host.h
+++ b/chrome/browser/utility_process_host.h
@@ -116,7 +116,8 @@ class UtilityProcessHost : public BrowserChildProcessHost {
DISALLOW_COPY_AND_ASSIGN(Client);
};
- UtilityProcessHost(Client* client, BrowserThread::ID client_thread_id);
+ UtilityProcessHost(ResourceDispatcherHost* rdh, Client* client,
+ BrowserThread::ID client_thread_id);
virtual ~UtilityProcessHost();
// Start a process to unpack the extension at the given path. The process
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 1bd0393..717c850 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -123,8 +123,6 @@ class WebResourceService::UnpackerClient
void Start() {
AddRef(); // balanced in Cleanup.
- // TODO(willchan): Look for a better signal of whether we're in a unit test
- // or not. Using |resource_dispatcher_host_| for this is pretty lame.
// If we don't have a resource_dispatcher_host_, assume we're in
// a test and run the unpacker directly in-process.
bool use_utility_process =
@@ -136,6 +134,7 @@ class WebResourceService::UnpackerClient
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &UnpackerClient::StartProcessOnIOThread,
+ web_resource_service_->resource_dispatcher_host_,
thread_id));
} else {
WebResourceUnpacker unpacker(json_data_);
@@ -179,8 +178,9 @@ class WebResourceService::UnpackerClient
Release();
}
- void StartProcessOnIOThread(BrowserThread::ID thread_id) {
- UtilityProcessHost* host = new UtilityProcessHost(this, thread_id);
+ void StartProcessOnIOThread(ResourceDispatcherHost* rdh,
+ BrowserThread::ID thread_id) {
+ UtilityProcessHost* host = new UtilityProcessHost(rdh, this, thread_id);
// TODO(mrc): get proper file path when we start using web resources
// that need to be unpacked.
host->StartWebResourceUnpacker(json_data_);
diff --git a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
index d995334..d3e0300 100644
--- a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
+++ b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#include "base/lazy_instance.h"
#include "base/synchronization/waitable_event.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/utility_process_host.h"
#include "content/common/indexed_db_key.h"
#include "content/common/serialized_script_value.h"
@@ -61,7 +62,7 @@ class KeyUtilityClientImpl
~KeyUtilityClientImpl();
void GetRDHAndStartUtilityProcess();
- void StartUtilityProcessInternal();
+ void StartUtilityProcessInternal(ResourceDispatcherHost* rdh);
void EndUtilityProcessInternal();
void CallStartIDBKeyFromValueAndKeyPathFromIOThread(
const std::vector<SerializedScriptValue>& values,
@@ -251,10 +252,12 @@ void KeyUtilityClientImpl::GetRDHAndStartUtilityProcess() {
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- StartUtilityProcessInternal();
+ StartUtilityProcessInternal(g_browser_process->resource_dispatcher_host());
}
-void KeyUtilityClientImpl::StartUtilityProcessInternal() {
+void KeyUtilityClientImpl::StartUtilityProcessInternal(
+ ResourceDispatcherHost* rdh) {
+ DCHECK(rdh);
// The ResourceDispatcherHost can only be used on the IO thread.
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -262,7 +265,8 @@ void KeyUtilityClientImpl::StartUtilityProcessInternal() {
BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
- &KeyUtilityClientImpl::StartUtilityProcessInternal));
+ &KeyUtilityClientImpl::StartUtilityProcessInternal,
+ rdh));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -270,7 +274,7 @@ void KeyUtilityClientImpl::StartUtilityProcessInternal() {
client_ = new KeyUtilityClientImpl::Client(this);
utility_process_host_ = new UtilityProcessHost(
- client_.get(), BrowserThread::IO);
+ rdh, client_.get(), BrowserThread::IO);
utility_process_host_->StartBatchMode();
state_ = STATE_INITIALIZED;
waitable_event_.Signal();