| OLD | NEW |
| 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 Loading... |
| 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 utility_host_->set_use_linux_zygote(true); |
| 76 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(webstore_data_)); | 77 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(webstore_data_)); |
| 77 } | 78 } |
| 78 | 79 |
| 79 // Implementing pieces of the UtilityProcessHost::Client interface. | 80 // Implementing pieces of the UtilityProcessHost::Client interface. |
| 80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 81 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
| 81 bool handled = true; | 82 bool handled = true; |
| 82 IPC_BEGIN_MESSAGE_MAP(SafeWebstoreResponseParser, message) | 83 IPC_BEGIN_MESSAGE_MAP(SafeWebstoreResponseParser, message) |
| 83 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, | 84 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
| 84 OnJSONParseSucceeded) | 85 OnJSONParseSucceeded) |
| 85 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 86 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 if (tab_contents()) { | 429 if (tab_contents()) { |
| 429 if (error.empty()) { | 430 if (error.empty()) { |
| 430 delegate_->OnInlineInstallSuccess(install_id_); | 431 delegate_->OnInlineInstallSuccess(install_id_); |
| 431 } else { | 432 } else { |
| 432 delegate_->OnInlineInstallFailure(install_id_, error); | 433 delegate_->OnInlineInstallFailure(install_id_, error); |
| 433 } | 434 } |
| 434 } | 435 } |
| 435 | 436 |
| 436 Release(); // Matches the AddRef in BeginInstall. | 437 Release(); // Matches the AddRef in BeginInstall. |
| 437 } | 438 } |
| OLD | NEW |