Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/common/origin_util.h" | |
| 6 | |
| 7 #include "content/public/common/url_constants.h" | |
| 8 #include "extensions/common/constants.h" | |
| 9 #include "net/base/net_util.h" | |
| 10 #include "url/gurl.h" | |
| 11 | |
| 12 bool IsOriginSecure(const GURL& url) { | |
| 13 if (url.SchemeUsesTLS() || url.SchemeIsFile()) | |
|
markusheintz_
2015/04/15 14:12:36
hm ... I may remember something wrong here (sorry
palmer
2015/04/16 17:15:40
We decided that, as far as the browser can know, t
| |
| 14 return true; | |
| 15 | |
| 16 if (url.SchemeIsFileSystem() && url.inner_url() && | |
| 17 IsOriginSecure(*url.inner_url())) { | |
| 18 return true; | |
| 19 } | |
| 20 | |
| 21 std::string hostname = url.HostNoBrackets(); | |
| 22 if (net::IsLocalhost(hostname) || net::IsLocalhostTLD(hostname)) | |
|
estark
2015/04/15 00:35:52
Was just looking at this out of curiosity and noti
palmer
2015/04/16 17:15:40
Ah, thanks.
| |
| 23 return true; | |
| 24 | |
| 25 std::string scheme = url.scheme(); | |
| 26 if (scheme == content::kChromeUIScheme || | |
| 27 scheme == extensions::kExtensionScheme || | |
| 28 scheme == extensions::kExtensionResourceScheme) { | |
| 29 return true; | |
| 30 } | |
| 31 | |
| 32 return false; | |
| 33 } | |
| OLD | NEW |