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 utility_host_->set_use_linux_zygote(true); |
71 utility_host_->StartBatchMode(); | 72 utility_host_->StartBatchMode(); |
72 | 73 |
73 if (!icon_base64_data_.empty()) | 74 if (!icon_base64_data_.empty()) |
74 utility_host_->Send( | 75 utility_host_->Send( |
75 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); | 76 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); |
76 | 77 |
77 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 78 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
78 } | 79 } |
79 | 80 |
80 void WebstoreInstallHelper::OnURLFetchComplete( | 81 void WebstoreInstallHelper::OnURLFetchComplete( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this)); | 181 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this)); |
181 } | 182 } |
182 | 183 |
183 void WebstoreInstallHelper::ReportResultFromUIThread() { | 184 void WebstoreInstallHelper::ReportResultFromUIThread() { |
184 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 185 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
185 if (error_.empty() && parsed_manifest_.get()) | 186 if (error_.empty() && parsed_manifest_.get()) |
186 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); | 187 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); |
187 else | 188 else |
188 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); | 189 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); |
189 } | 190 } |
OLD | NEW |