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

Side by Side Diff: content/browser/ssl/ssl_policy.cc

Issue 1131073002: Change content/browser GURL::SchemeIsSecure calls to SchemeIsCryptographic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/ssl/ssl_policy.h" 5 #include "content/browser/ssl/ssl_policy.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 SSL_GOOD_CERT_SEEN_EVENT_MAX); 136 SSL_GOOD_CERT_SEEN_EVENT_MAX);
137 } 137 }
138 } 138 }
139 139
140 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, 140 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
141 WebContentsImpl* web_contents) { 141 WebContentsImpl* web_contents) {
142 DCHECK(entry); 142 DCHECK(entry);
143 143
144 InitializeEntryIfNeeded(entry); 144 InitializeEntryIfNeeded(entry);
145 145
146 if (!entry->GetURL().SchemeIsSecure()) 146 if (!entry->GetURL().SchemeIsCryptographic())
147 return; 147 return;
148 148
149 if (!web_contents->DisplayedInsecureContent()) 149 if (!web_contents->DisplayedInsecureContent())
150 entry->GetSSL().content_status &= ~SSLStatus::DISPLAYED_INSECURE_CONTENT; 150 entry->GetSSL().content_status &= ~SSLStatus::DISPLAYED_INSECURE_CONTENT;
151 151
152 // An HTTPS response may not have a certificate for some reason. When that 152 // An HTTPS response may not have a certificate for some reason. When that
153 // happens, use the unauthenticated (HTTP) rather than the authentication 153 // happens, use the unauthenticated (HTTP) rather than the authentication
154 // broken security style so that we can detect this error condition. 154 // broken security style so that we can detect this error condition.
155 if (!entry->GetSSL().cert_id) { 155 if (!entry->GetSSL().cert_id) {
156 entry->GetSSL().security_style = SECURITY_STYLE_UNAUTHENTICATED; 156 entry->GetSSL().security_style = SECURITY_STYLE_UNAUTHENTICATED;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 break; 244 break;
245 default: 245 default:
246 NOTREACHED(); 246 NOTREACHED();
247 } 247 }
248 } 248 }
249 249
250 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { 250 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) {
251 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) 251 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN)
252 return; 252 return;
253 253
254 entry->GetSSL().security_style = entry->GetURL().SchemeIsSecure() ? 254 entry->GetSSL().security_style = entry->GetURL().SchemeIsCryptographic() ?
255 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED; 255 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED;
256 } 256 }
257 257
258 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { 258 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) {
259 GURL parsed_origin(origin); 259 GURL parsed_origin(origin);
260 if (parsed_origin.SchemeIsSecure()) 260 if (parsed_origin.SchemeIsCryptographic())
261 backend_->HostRanInsecureContent(parsed_origin.host(), pid); 261 backend_->HostRanInsecureContent(parsed_origin.host(), pid);
262 } 262 }
263 263
264 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698