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

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

Issue 2225213004: Teach SSLHostStateDelegate about subresources with cert errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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_backend.h" 5 #include "content/browser/ssl/ssl_policy_backend.h"
6 6
7 #include "content/browser/frame_host/navigation_controller_impl.h" 7 #include "content/browser/frame_host/navigation_controller_impl.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/ssl_host_state_delegate.h" 9 #include "content/public/browser/ssl_host_state_delegate.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller) 13 SSLPolicyBackend::SSLPolicyBackend(NavigationControllerImpl* controller)
14 : ssl_host_state_delegate_( 14 : ssl_host_state_delegate_(
15 controller->GetBrowserContext()->GetSSLHostStateDelegate()), 15 controller->GetBrowserContext()->GetSSLHostStateDelegate()),
16 controller_(controller) { 16 controller_(controller) {
17 DCHECK(controller_); 17 DCHECK(controller_);
18 } 18 }
19 19
20 void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) { 20 void SSLPolicyBackend::HostRanInsecureContent(const std::string& host, int id) {
21 if (ssl_host_state_delegate_) 21 if (ssl_host_state_delegate_)
22 ssl_host_state_delegate_->HostRanInsecureContent(host, id); 22 ssl_host_state_delegate_->HostRanInsecureContent(
23 host, id, SSLHostStateDelegate::MIXED_CONTENT);
jww 2016/08/11 18:50:15 Okay, this has me very confused. I think maybe tha
jam 2016/08/11 19:53:12 jww: since i got the next patch to review in this
estark 2016/08/11 20:58:38 Urgh, yeah, I tried to split up a giant CL into sm
jww 2016/08/11 21:13:24 Great, thanks for the clarifications!
jam 2016/08/11 21:14:04 That would be really great for readability. I've b
23 SSLManager::NotifySSLInternalStateChanged(controller_->GetBrowserContext()); 24 SSLManager::NotifySSLInternalStateChanged(controller_->GetBrowserContext());
24 } 25 }
25 26
26 bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host, 27 bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host,
27 int pid) const { 28 int pid) const {
28 if (!ssl_host_state_delegate_) 29 if (!ssl_host_state_delegate_)
29 return false; 30 return false;
30 31
31 return ssl_host_state_delegate_->DidHostRunInsecureContent(host, pid); 32 return ssl_host_state_delegate_->DidHostRunInsecureContent(
jww 2016/08/11 18:50:15 This is especially confusing. I would expect this
estark 2016/08/11 20:58:38 Same explanation as above, I think. In the follow-
33 host, pid, SSLHostStateDelegate::MIXED_CONTENT);
32 } 34 }
33 35
34 void SSLPolicyBackend::RevokeUserAllowExceptions(const std::string& host) { 36 void SSLPolicyBackend::RevokeUserAllowExceptions(const std::string& host) {
35 if (!ssl_host_state_delegate_) 37 if (!ssl_host_state_delegate_)
36 return; 38 return;
37 39
38 ssl_host_state_delegate_->RevokeUserAllowExceptions(host); 40 ssl_host_state_delegate_->RevokeUserAllowExceptions(host);
39 } 41 }
40 42
41 bool SSLPolicyBackend::HasAllowException(const std::string& host) { 43 bool SSLPolicyBackend::HasAllowException(const std::string& host) {
(...skipping 15 matching lines...) Expand all
57 const std::string& host, 59 const std::string& host,
58 net::CertStatus error, 60 net::CertStatus error,
59 bool* expired_previous_decision) { 61 bool* expired_previous_decision) {
60 return ssl_host_state_delegate_ ? 62 return ssl_host_state_delegate_ ?
61 ssl_host_state_delegate_->QueryPolicy( 63 ssl_host_state_delegate_->QueryPolicy(
62 host, cert, error, expired_previous_decision) : 64 host, cert, error, expired_previous_decision) :
63 SSLHostStateDelegate::DENIED; 65 SSLHostStateDelegate::DENIED;
64 } 66 }
65 67
66 } // namespace content 68 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698