Commit a2da0cfd authored by lgarron's avatar lgarron Committed by Commit bot

Switch //components to use SchemeIsCryptographic() instead of SchemeIsSecure().

We recently introduced SchemeIsCryptographic() and IsOriginSecure(),
which are meant to replace SchemeIsSecure().

IsOriginSecure() roughly means "do we trust this content not to be
tampered with before it reaches the user?" [1] This is a higher-level
definition that corresponds to the new "privileged contexts" spec. [2]

SchemeIsCryptographic() [3] is close to the old definition of
SchemeIsSecure(), and literally just checks if the scheme is a
cryptographic scheme (HTTPS or WSS as of right now). The difference is
that SchemeIsCryptographic() will not consider filesystem URLs secure.

[1] https://code.google.com/p/chromium/codesearch#chromium/src/content/public/common/origin_util.h&sq=package:chromium&type=cs&l=19&rcl=143099866
[2] https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features and https://w3c.github.io/webappsec/specs/powerfulfeatures/
[3] https://code.google.com/p/chromium/codesearch#chromium/src/url/gurl.h&sq=package:chromium&type=cs&l=250&rcl=1430998666

BUG=362214

Review URL: https://codereview.chromium.org/1135693002

Cr-Commit-Position: refs/heads/master@{#329481}
parent 60673b43
......@@ -112,7 +112,8 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry(
net::ProxyServer::SCHEME_HTTP, request->proxy_server());
data_reduction_proxy_type_info.is_alternative = false;
data_reduction_proxy_type_info.is_fallback = false;
data_reduction_proxy_type_info.is_ssl = request->url().SchemeIsSecure();
data_reduction_proxy_type_info.is_ssl =
request->url().SchemeIsCryptographic();
}
// TODO(bengr): Implement bypass for CONNECT tunnel.
if (data_reduction_proxy_type_info.is_ssl)
......
......@@ -586,7 +586,7 @@ class DataReductionProxyBypassStatsEndToEndTest : public testing::Test {
const char* retry_response_body) {
// Support HTTPS URLs.
net::SSLSocketDataProvider ssl_socket_data_provider(net::ASYNC, net::OK);
if (url.SchemeIsSecure()) {
if (url.SchemeIsCryptographic()) {
mock_socket_factory_.AddSSLSocketDataProvider(&ssl_socket_data_provider);
}
......
......@@ -129,7 +129,7 @@ TEST(ChromeNetworkDailyDataSavingMetricsTest,
// Create a fake URLRequest and fill it with the appropriate response
// headers and proxy server by executing it with fake socket data.
net::SSLSocketDataProvider ssl_socket_data_provider(net::ASYNC, net::OK);
if (test_case.url.SchemeIsSecure())
if (test_case.url.SchemeIsCryptographic())
mock_socket_factory.AddSSLSocketDataProvider(&ssl_socket_data_provider);
MockRead mock_reads[] = {
MockRead(test_case.response_headers),
......
......@@ -150,7 +150,7 @@ bool ShouldUseFixUrlServiceForError(const blink::WebURLError& error,
// Don't use the correction service for HTTPS (for privacy reasons).
GURL unreachable_url(error.unreachableURL);
if (GURL(unreachable_url).SchemeIsSecure())
if (GURL(unreachable_url).SchemeIsCryptographic())
return false;
std::string domain = error.domain.utf8();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment