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

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

Issue 2224693002: Mark active mixed content even if there is a certificate error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser tests Created 4 years, 4 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 | « chrome/browser/ssl/ssl_browser_tests.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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 if (entry->GetSSL().security_style == SECURITY_STYLE_UNAUTHENTICATED) 150 if (entry->GetSSL().security_style == SECURITY_STYLE_UNAUTHENTICATED)
151 return; 151 return;
152 152
153 if (!web_contents->DisplayedInsecureContent()) 153 if (!web_contents->DisplayedInsecureContent())
154 entry->GetSSL().content_status &= ~SSLStatus::DISPLAYED_INSECURE_CONTENT; 154 entry->GetSSL().content_status &= ~SSLStatus::DISPLAYED_INSECURE_CONTENT;
155 155
156 if (web_contents->DisplayedInsecureContent()) 156 if (web_contents->DisplayedInsecureContent())
157 entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT; 157 entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT;
158 158
159 if (entry->GetSSL().security_style == SECURITY_STYLE_AUTHENTICATION_BROKEN)
160 return;
161
162 SiteInstance* site_instance = entry->site_instance(); 159 SiteInstance* site_instance = entry->site_instance();
163 // Note that |site_instance| can be NULL here because NavigationEntries don't 160 // Note that |site_instance| can be NULL here because NavigationEntries don't
164 // necessarily have site instances. Without a process, the entry can't 161 // necessarily have site instances. Without a process, the entry can't
165 // possibly have insecure content. See bug http://crbug.com/12423. 162 // possibly have insecure content. See bug http://crbug.com/12423.
166 if (site_instance && 163 if (site_instance &&
167 backend_->DidHostRunInsecureContent( 164 backend_->DidHostRunInsecureContent(
168 entry->GetURL().host(), site_instance->GetProcess()->GetID())) { 165 entry->GetURL().host(), site_instance->GetProcess()->GetID())) {
169 entry->GetSSL().security_style = 166 entry->GetSSL().security_style =
170 SECURITY_STYLE_AUTHENTICATION_BROKEN; 167 SECURITY_STYLE_AUTHENTICATION_BROKEN;
171 entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT; 168 entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT;
172 return;
173 } 169 }
174 } 170 }
175 171
176 // Static 172 // Static
177 SecurityStyle SSLPolicy::GetSecurityStyleForResource( 173 SecurityStyle SSLPolicy::GetSecurityStyleForResource(
178 const GURL& url, 174 const GURL& url,
179 int cert_id, 175 int cert_id,
180 net::CertStatus cert_status) { 176 net::CertStatus cert_status) {
181 // An HTTPS response may not have a certificate for some reason. When that 177 // An HTTPS response may not have a certificate for some reason. When that
182 // happens, use the unauthenticated (HTTP) rather than the authentication 178 // happens, use the unauthenticated (HTTP) rather than the authentication
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 249
254 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { 250 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) {
255 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) 251 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN)
256 return; 252 return;
257 253
258 entry->GetSSL().security_style = GetSecurityStyleForResource( 254 entry->GetSSL().security_style = GetSecurityStyleForResource(
259 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); 255 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status);
260 } 256 }
261 257
262 } // namespace content 258 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698