| Index: chrome/common/extensions/chrome_extensions_client.cc
|
| diff --git a/chrome/common/extensions/chrome_extensions_client.cc b/chrome/common/extensions/chrome_extensions_client.cc
|
| index 2fe9459e2de6cd408837a4d51029828be1a3fff7..9a4a929ae7b1dddc2643342e158c230cbd045d26 100644
|
| --- a/chrome/common/extensions/chrome_extensions_client.cc
|
| +++ b/chrome/common/extensions/chrome_extensions_client.cc
|
| @@ -281,12 +281,20 @@ std::string ChromeExtensionsClient::GetWebstoreBaseURL() const {
|
| return gallery_prefix;
|
| }
|
|
|
| -std::string ChromeExtensionsClient::GetWebstoreUpdateURL() const {
|
| +const GURL& ChromeExtensionsClient::GetWebstoreUpdateURL() const {
|
| + // Browser tests like to alter the command line at runtime with new update
|
| + // URLs. Just update the cached value of the update url (to avoid reparsing
|
| + // it) if the value has changed.
|
| base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
|
| - if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL))
|
| - return cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL);
|
| - else
|
| - return extension_urls::GetDefaultWebstoreUpdateUrl().spec();
|
| + if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) {
|
| + std::string url =
|
| + cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL);
|
| + if (webstore_update_url_ != url)
|
| + webstore_update_url_ = GURL(url);
|
| + } else if (webstore_update_url_.is_empty()) {
|
| + webstore_update_url_ = GURL(extension_urls::GetDefaultWebstoreUpdateUrl());
|
| + }
|
| + return webstore_update_url_;
|
| }
|
|
|
| bool ChromeExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const {
|
|
|