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/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_temp_dir.h" | 10 #include "base/memory/scoped_temp_dir.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 icon_decode_complete_(false), | 157 icon_decode_complete_(false), |
158 manifest_parse_complete_(false), | 158 manifest_parse_complete_(false), |
159 parse_error_(BeginInstallWithManifestFunction::UNKNOWN_ERROR) {} | 159 parse_error_(BeginInstallWithManifestFunction::UNKNOWN_ERROR) {} |
160 | 160 |
161 void Start() { | 161 void Start() { |
162 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 162 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
163 BrowserThread::PostTask( | 163 BrowserThread::PostTask( |
164 BrowserThread::IO, | 164 BrowserThread::IO, |
165 FROM_HERE, | 165 FROM_HERE, |
166 NewRunnableMethod(this, | 166 NewRunnableMethod(this, |
167 &SafeBeginInstallHelper::StartWorkOnIOThread, | 167 &SafeBeginInstallHelper::StartWorkOnIOThread)); |
168 g_browser_process->resource_dispatcher_host())); | |
169 } | 168 } |
170 | 169 |
171 void StartWorkOnIOThread(ResourceDispatcherHost* rdh) { | 170 void StartWorkOnIOThread() { |
172 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 171 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
173 utility_host_ = new UtilityProcessHost(rdh, this, BrowserThread::IO); | 172 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); |
174 utility_host_->StartBatchMode(); | 173 utility_host_->StartBatchMode(); |
175 if (icon_data_.empty()) | 174 if (icon_data_.empty()) |
176 icon_decode_complete_ = true; | 175 icon_decode_complete_ = true; |
177 else | 176 else |
178 utility_host_->StartImageDecodingBase64(icon_data_); | 177 utility_host_->StartImageDecodingBase64(icon_data_); |
179 utility_host_->StartJSONParsing(manifest_); | 178 utility_host_->StartJSONParsing(manifest_); |
180 } | 179 } |
181 | 180 |
182 // Implementing pieces of the UtilityProcessHost::Client interface. | 181 // Implementing pieces of the UtilityProcessHost::Client interface. |
183 virtual void OnDecodeImageSucceeded(const SkBitmap& decoded_image) { | 182 virtual void OnDecodeImageSucceeded(const SkBitmap& decoded_image) { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 } | 578 } |
580 | 579 |
581 DCHECK(waiting_for_token_); | 580 DCHECK(waiting_for_token_); |
582 | 581 |
583 result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); | 582 result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); |
584 SendResponse(true); | 583 SendResponse(true); |
585 | 584 |
586 // Matches the AddRef in RunImpl(). | 585 // Matches the AddRef in RunImpl(). |
587 Release(); | 586 Release(); |
588 } | 587 } |
OLD | NEW |