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

Side by Side Diff: chrome/browser/extensions/webstore_inline_installer.cc

Issue 8770025: Zygote most of the uses of the utility process on Linux (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/webstore_inline_installer.h" 5 #include "chrome/browser/extensions/webstore_inline_installer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 66 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
67 BrowserThread::PostTask( 67 BrowserThread::PostTask(
68 BrowserThread::IO, 68 BrowserThread::IO,
69 FROM_HERE, 69 FROM_HERE,
70 base::Bind(&SafeWebstoreResponseParser::StartWorkOnIOThread, this)); 70 base::Bind(&SafeWebstoreResponseParser::StartWorkOnIOThread, this));
71 } 71 }
72 72
73 void StartWorkOnIOThread() { 73 void StartWorkOnIOThread() {
74 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 74 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
75 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); 75 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO);
76 #if defined(OS_LINUX)
77 utility_host_->set_should_use_zygote(true);
78 #endif
76 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(webstore_data_)); 79 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(webstore_data_));
77 } 80 }
78 81
79 // Implementing pieces of the UtilityProcessHost::Client interface. 82 // Implementing pieces of the UtilityProcessHost::Client interface.
80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { 83 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
81 bool handled = true; 84 bool handled = true;
82 IPC_BEGIN_MESSAGE_MAP(SafeWebstoreResponseParser, message) 85 IPC_BEGIN_MESSAGE_MAP(SafeWebstoreResponseParser, message)
83 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, 86 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded,
84 OnJSONParseSucceeded) 87 OnJSONParseSucceeded)
85 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, 88 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed,
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 if (tab_contents()) { 429 if (tab_contents()) {
427 if (error.empty()) { 430 if (error.empty()) {
428 delegate_->OnInlineInstallSuccess(install_id_); 431 delegate_->OnInlineInstallSuccess(install_id_);
429 } else { 432 } else {
430 delegate_->OnInlineInstallFailure(install_id_, error); 433 delegate_->OnInlineInstallFailure(install_id_, error);
431 } 434 }
432 } 435 }
433 436
434 Release(); // Matches the AddRef in BeginInstall. 437 Release(); // Matches the AddRef in BeginInstall.
435 } 438 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698