Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/extensions/webstore_standalone_installer.cc

Issue 2506713002: Avoid parsing the webstore base url so much. (Closed)
Patch Set: fix chromeos Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_standalone_installer.h" 5 #include "chrome/browser/extensions/webstore_standalone_installer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 // Icon URL is optional. 292 // Icon URL is optional.
293 GURL icon_url; 293 GURL icon_url;
294 if (webstore_data->HasKey(kIconUrlKey)) { 294 if (webstore_data->HasKey(kIconUrlKey)) {
295 std::string icon_url_string; 295 std::string icon_url_string;
296 if (!webstore_data->GetString(kIconUrlKey, &icon_url_string)) { 296 if (!webstore_data->GetString(kIconUrlKey, &icon_url_string)) {
297 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE, 297 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE,
298 webstore_install::kInvalidWebstoreResponseError); 298 webstore_install::kInvalidWebstoreResponseError);
299 return; 299 return;
300 } 300 }
301 icon_url = GURL(extension_urls::GetWebstoreLaunchURL()).Resolve( 301 icon_url = extension_urls::GetWebstoreLaunchURL().Resolve(icon_url_string);
302 icon_url_string);
303 if (!icon_url.is_valid()) { 302 if (!icon_url.is_valid()) {
304 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE, 303 CompleteInstall(webstore_install::INVALID_WEBSTORE_RESPONSE,
305 webstore_install::kInvalidWebstoreResponseError); 304 webstore_install::kInvalidWebstoreResponseError);
306 return; 305 return;
307 } 306 }
308 } 307 }
309 308
310 // Assume ownership of webstore_data. 309 // Assume ownership of webstore_data.
311 webstore_data_ = std::move(webstore_data); 310 webstore_data_ = std::move(webstore_data);
312 311
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { 409 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() {
411 // An instance of this class is passed in as a delegate for the 410 // An instance of this class is passed in as a delegate for the
412 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and 411 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and
413 // therefore needs to remain alive until they are done. Clear the webstore 412 // therefore needs to remain alive until they are done. Clear the webstore
414 // data fetcher to avoid calling Release in AbortInstall while any of these 413 // data fetcher to avoid calling Release in AbortInstall while any of these
415 // operations are in progress. 414 // operations are in progress.
416 webstore_data_fetcher_.reset(); 415 webstore_data_fetcher_.reset();
417 } 416 }
418 417
419 } // namespace extensions 418 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698