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

Unified Diff: content/public/common/origin_util.cc

Issue 1072933006: Support whitelisting to handle insecure origins as trustworthy origins (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added test, added IsOriginSecure plumbing etc Created 5 years, 8 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
« content/public/common/origin_util.h ('K') | « content/public/common/origin_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/origin_util.cc
diff --git a/chrome/common/origin_util.cc b/content/public/common/origin_util.cc
similarity index 55%
copy from chrome/common/origin_util.cc
copy to content/public/common/origin_util.cc
index 2884d74e2b9b9fa97fa803f2b892d8b701743ee7..44bfbccd7e4432f133d279688ef385e30e5f0deb 100644
--- a/chrome/common/origin_util.cc
+++ b/content/public/common/origin_util.cc
@@ -1,14 +1,14 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/origin_util.h"
+#include "content/public/common/origin_util.h"
-#include "content/public/common/url_constants.h"
-#include "extensions/common/constants.h"
#include "net/base/net_util.h"
#include "url/gurl.h"
+namespace content {
+
bool IsOriginSecure(const GURL& url) {
if (url.SchemeUsesTLS() || url.SchemeIsFile())
return true;
@@ -22,12 +22,7 @@ bool IsOriginSecure(const GURL& url) {
if (net::IsLocalhost(hostname))
return true;
- std::string scheme = url.scheme();
- if (scheme == content::kChromeUIScheme ||
- scheme == extensions::kExtensionScheme ||
- scheme == extensions::kExtensionResourceScheme) {
- return true;
- }
-
return false;
}
+
+} // namespace content
« content/public/common/origin_util.h ('K') | « content/public/common/origin_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698