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

Unified Diff: chrome/common/extensions/extension_constants.cc

Issue 10446027: Force update checks to use SSL for store-hosted extensions/apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_constants.cc
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index d5e30eab3f496b65497be5cc69a9d050386ef183..e3df155bb899fb6c0a4e33ad143b0a2d751222e4 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -43,8 +43,6 @@ GURL GetWebstoreItemJsonDataURL(const std::string& extension_id) {
return GURL(GetWebstoreLaunchURL() + "/inlineinstall/detail/" + extension_id);
}
-const char kGalleryUpdateHttpUrl[] =
- "http://clients2.google.com/service/update2/crx";
const char kGalleryUpdateHttpsUrl[] =
"https://clients2.google.com/service/update2/crx";
// TODO(battre): Delete the HTTP URL once the blacklist is downloaded via HTTPS.
@@ -53,17 +51,22 @@ const char kExtensionBlocklistUrlPrefix[] =
const char kExtensionBlocklistHttpsUrlPrefix[] =
"https://www.gstatic.com/chrome/extensions/blacklist";
-GURL GetWebstoreUpdateUrl(bool secure) {
+GURL GetWebstoreUpdateUrl() {
CommandLine* cmdline = CommandLine::ForCurrentProcess();
if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL))
return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL));
else
- return GURL(secure ? kGalleryUpdateHttpsUrl : kGalleryUpdateHttpUrl);
+ return GURL(kGalleryUpdateHttpsUrl);
}
bool IsWebstoreUpdateUrl(const GURL& update_url) {
- return update_url == GetWebstoreUpdateUrl(false) ||
- update_url == GetWebstoreUpdateUrl(true);
+ GURL store_url = GetWebstoreUpdateUrl();
+ if (update_url == store_url) {
+ return true;
+ } else {
+ return (update_url.host() == store_url.host() &&
+ update_url.path() == store_url.path());
+ }
}
bool IsBlacklistUpdateUrl(const GURL& url) {

Powered by Google App Engine
This is Rietveld 408576698