OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 url_fetcher_->Start(); | 69 url_fetcher_->Start(); |
70 // We'll get called back in OnURLFetchComplete. | 70 // We'll get called back in OnURLFetchComplete. |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 void WebstoreInstallHelper::StartWorkOnIOThread() { | 74 void WebstoreInstallHelper::StartWorkOnIOThread() { |
75 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 75 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
76 utility_host_ = UtilityProcessHost::Create( | 76 utility_host_ = UtilityProcessHost::Create( |
77 this, base::MessageLoopProxy::current().get())->AsWeakPtr(); | 77 this, base::MessageLoopProxy::current().get())->AsWeakPtr(); |
78 utility_host_->EnableZygote(); | |
79 utility_host_->StartBatchMode(); | 78 utility_host_->StartBatchMode(); |
80 | 79 |
81 if (!icon_base64_data_.empty()) | 80 if (!icon_base64_data_.empty()) |
82 utility_host_->Send( | 81 utility_host_->Send( |
83 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); | 82 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); |
84 | 83 |
85 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 84 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
86 } | 85 } |
87 | 86 |
88 void WebstoreInstallHelper::OnURLFetchComplete( | 87 void WebstoreInstallHelper::OnURLFetchComplete( |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 192 |
194 void WebstoreInstallHelper::ReportResultFromUIThread() { | 193 void WebstoreInstallHelper::ReportResultFromUIThread() { |
195 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
196 if (error_.empty() && parsed_manifest_) | 195 if (error_.empty() && parsed_manifest_) |
197 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); | 196 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); |
198 else | 197 else |
199 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); | 198 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); |
200 } | 199 } |
201 | 200 |
202 } // namespace extensions | 201 } // namespace extensions |
OLD | NEW |