| 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_install_helper.h" | 5 #include "chrome/browser/extensions/webstore_install_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 url_fetcher_->SetRequestContext(context_getter_); | 61 url_fetcher_->SetRequestContext(context_getter_); |
| 62 | 62 |
| 63 url_fetcher_->Start(); | 63 url_fetcher_->Start(); |
| 64 // We'll get called back in OnURLFetchComplete. | 64 // We'll get called back in OnURLFetchComplete. |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void WebstoreInstallHelper::StartWorkOnIOThread() { | 68 void WebstoreInstallHelper::StartWorkOnIOThread() { |
| 69 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 69 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 70 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); | 70 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); |
| 71 #if defined(OS_LINUX) |
| 72 utility_host_->set_should_use_zygote(true); |
| 73 #endif |
| 71 utility_host_->StartBatchMode(); | 74 utility_host_->StartBatchMode(); |
| 72 | 75 |
| 73 if (!icon_base64_data_.empty()) | 76 if (!icon_base64_data_.empty()) |
| 74 utility_host_->Send( | 77 utility_host_->Send( |
| 75 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); | 78 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); |
| 76 | 79 |
| 77 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 80 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
| 78 } | 81 } |
| 79 | 82 |
| 80 void WebstoreInstallHelper::OnURLFetchComplete( | 83 void WebstoreInstallHelper::OnURLFetchComplete( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this)); | 183 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this)); |
| 181 } | 184 } |
| 182 | 185 |
| 183 void WebstoreInstallHelper::ReportResultFromUIThread() { | 186 void WebstoreInstallHelper::ReportResultFromUIThread() { |
| 184 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 187 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 185 if (error_.empty() && parsed_manifest_.get()) | 188 if (error_.empty() && parsed_manifest_.get()) |
| 186 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); | 189 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); |
| 187 else | 190 else |
| 188 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); | 191 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); |
| 189 } | 192 } |
| OLD | NEW |