summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 16:11:35 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 16:11:35 +0000
commitb98b0decec407b51de69cd60bf4c0c903d65f8e1 (patch)
tree167ab65b3bee9af92d792ba1fa37973741983263
parent766a6923903d8aa4f2d15f603b0f628e97980426 (diff)
downloadchromium_src-b98b0decec407b51de69cd60bf4c0c903d65f8e1.zip
chromium_src-b98b0decec407b51de69cd60bf4c0c903d65f8e1.tar.gz
chromium_src-b98b0decec407b51de69cd60bf4c0c903d65f8e1.tar.bz2
Do not use the utility process on linux.
We don't currently use the zygote to spawn the utility process, so after browser updates bad bugs can occur with mismatched subprocesses. See crbug.com/23327 and crbug.com/22703. BUG=23327 TEST=Extensions installation/autoupdate and New Tab Page tip download should still work. Review URL: http://codereview.chromium.org/256036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27997 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_updater.cc12
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc12
-rw-r--r--chrome/browser/utility_process_host.cc7
-rw-r--r--chrome/browser/utility_process_host_unittest.cc4
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc16
5 files changed, 43 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 774d892..cbd9061 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -247,8 +247,16 @@ class SafeManifestParser : public UtilityProcessHost::Client {
// TODO(asargent) we shouldn't need to do this branch here - instead
// UtilityProcessHost should handle it for us. (http://crbug.com/19192)
- if (rdh && !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSingleProcess)) {
+ bool use_utility_process = rdh &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
+
+#if defined(OS_POSIX)
+ // TODO(port): Don't use a utility process on linux (crbug.com/22703) or
+ // MacOS (crbug.com/8102) until problems related to autoupdate are fixed.
+ use_utility_process = false;
+#endif
+
+ if (use_utility_process) {
UtilityProcessHost* host = new UtilityProcessHost(
rdh, this, updater_loop_);
host->StartUpdateManifestParse(xml_);
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 7003139..9d043b7 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -63,8 +63,16 @@ void SandboxedExtensionUnpacker::Start() {
//
// TODO(asargent) we shouldn't need to do this branch here - instead
// UtilityProcessHost should handle it for us. (http://crbug.com/19192)
- if (rdh_ &&
- !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) {
+ bool use_utility_process = rdh_ &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
+
+#if defined(OS_POSIX)
+ // TODO(port): Don't use a utility process on linux (crbug.com/22703) or
+ // MacOS (crbug.com/8102) until problems related to autoupdate are fixed.
+ use_utility_process = false;
+#endif
+
+ if (use_utility_process) {
ChromeThread::GetMessageLoop(ChromeThread::IO)->PostTask(FROM_HERE,
NewRunnableMethod(this,
&SandboxedExtensionUnpacker::StartProcessOnIOThread,
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index 32ef600..246e7ff 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -64,6 +64,13 @@ std::wstring UtilityProcessHost::GetUtilityProcessCmd() {
}
bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
+#if defined(OS_POSIX)
+ // TODO(port): We should not reach here on linux (crbug.com/22703) or
+ // MacOS (crbug.com/8102) until problems related to autoupdate are fixed.
+ NOTREACHED();
+ return false;
+#endif
+
// Name must be set or metrics_service will crash in any test which
// launches a UtilityProcessHost.
set_name(L"utility process");
diff --git a/chrome/browser/utility_process_host_unittest.cc b/chrome/browser/utility_process_host_unittest.cc
index 43ac61b..8874719 100644
--- a/chrome/browser/utility_process_host_unittest.cc
+++ b/chrome/browser/utility_process_host_unittest.cc
@@ -124,6 +124,9 @@ class ProcessClosedObserver : public NotificationObserver {
bool observed_;
};
+#if !defined(OS_POSIX)
+// We should not run this on linux (crbug.com/22703) or MacOS (crbug.com/8102)
+// until problems related to autoupdate are fixed.
TEST_F(UtilityProcessHostTest, ExtensionUnpacker) {
// Copy the test extension into a temp dir and install from the temp dir.
FilePath extension_file;
@@ -152,5 +155,6 @@ TEST_F(UtilityProcessHostTest, ExtensionUnpacker) {
// Clean up the temp dir.
file_util::Delete(temp_extension_dir, true);
}
+#endif
} // namespace
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index dcfeade..f401807 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -103,14 +103,23 @@ class WebResourceService::UnpackerClient
void Start() {
AddRef(); // balanced in Cleanup.
- if (web_resource_service_->resource_dispatcher_host_) {
+ // 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 =
+ web_resource_service_->resource_dispatcher_host_ != NULL;
+
+#if defined(OS_POSIX)
+ // TODO(port): Don't use a utility process on linux (crbug.com/22703) or
+ // MacOS (crbug.com/8102) until problems related to autoupdate are fixed.
+ use_utility_process = false;
+#endif
+
+ if (use_utility_process) {
ChromeThread::GetMessageLoop(ChromeThread::IO)->PostTask(FROM_HERE,
NewRunnableMethod(this, &UnpackerClient::StartProcessOnIOThread,
web_resource_service_->resource_dispatcher_host_,
MessageLoop::current()));
} else {
- // If we don't have a resource_dispatcher_host_, assume we're in
- // a test and run the unpacker directly in-process.
WebResourceUnpacker unpacker(json_data_);
if (unpacker.Run()) {
OnUnpackWebResourceSucceeded(*unpacker.parsed_json());
@@ -287,4 +296,3 @@ void WebResourceService::UpdateResourceCache(const std::string& json_data) {
DoubleToWString(base::Time::Now().ToDoubleT()));
prefs_->SetString(prefs::kNTPTipsServer, web_resource_server_);
}
-