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

Side by Side Diff: chrome/browser/ssl/chrome_ssl_host_state_delegate.h

Issue 2225213004: Teach SSLHostStateDelegate about subresources with cert errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_
6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ 6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set>
9 10
10 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "content/public/browser/ssl_host_state_delegate.h" 14 #include "content/public/browser/ssl_host_state_delegate.h"
14 15
15 class Profile; 16 class Profile;
16 17
17 namespace base { 18 namespace base {
18 class Clock; 19 class Clock;
(...skipping 11 matching lines...) Expand all
30 31
31 // SSLHostStateDelegate: 32 // SSLHostStateDelegate:
32 void AllowCert(const std::string& host, 33 void AllowCert(const std::string& host,
33 const net::X509Certificate& cert, 34 const net::X509Certificate& cert,
34 net::CertStatus error) override; 35 net::CertStatus error) override;
35 void Clear() override; 36 void Clear() override;
36 CertJudgment QueryPolicy(const std::string& host, 37 CertJudgment QueryPolicy(const std::string& host,
37 const net::X509Certificate& cert, 38 const net::X509Certificate& cert,
38 net::CertStatus error, 39 net::CertStatus error,
39 bool* expired_previous_decision) override; 40 bool* expired_previous_decision) override;
40 void HostRanInsecureContent(const std::string& host, int pid) override; 41 void HostRanInsecureContent(const std::string& host,
41 bool DidHostRunInsecureContent(const std::string& host, 42 int pid,
42 int pid) const override; 43 InsecureContentType content_type) override;
44 bool DidHostRunInsecureContent(
45 const std::string& host,
46 int pid,
47 InsecureContentType content_type) const override;
43 48
44 // Revokes all SSL certificate error allow exceptions made by the user for 49 // Revokes all SSL certificate error allow exceptions made by the user for
45 // |host| in the given Profile. 50 // |host| in the given Profile.
46 void RevokeUserAllowExceptions(const std::string& host) override; 51 void RevokeUserAllowExceptions(const std::string& host) override;
47 52
48 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but 53 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but
49 // additionally may close idle connections in the process. This should be used 54 // additionally may close idle connections in the process. This should be used
50 // *only* for rare events, such as a user controlled button, as it may be very 55 // *only* for rare events, such as a user controlled button, as it may be very
51 // disruptive to the networking stack. 56 // disruptive to the networking stack.
52 virtual void RevokeUserAllowExceptionsHard(const std::string& host); 57 virtual void RevokeUserAllowExceptionsHard(const std::string& host);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 bool* expired_previous_decision); 108 bool* expired_previous_decision);
104 109
105 std::unique_ptr<base::Clock> clock_; 110 std::unique_ptr<base::Clock> clock_;
106 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_; 111 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_;
107 Profile* profile_; 112 Profile* profile_;
108 113
109 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host 114 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host
110 // contains insecure content in that renderer process. 115 // contains insecure content in that renderer process.
111 typedef std::pair<std::string, int> BrokenHostEntry; 116 typedef std::pair<std::string, int> BrokenHostEntry;
112 117
113 // Hosts which have been contaminated with insecure content in the 118 // Hosts which have been contaminated with insecure mixed content in the
114 // specified process. Note that insecure content can travel between 119 // specified process. Note that insecure content can travel between
115 // same-origin frames in one processs but cannot jump between processes. 120 // same-origin frames in one processs but cannot jump between processes.
116 std::set<BrokenHostEntry> ran_insecure_content_hosts_; 121 std::set<BrokenHostEntry> ran_mixed_content_hosts_;
122
123 // Hosts which have been contaminated with content with certificate errors in
124 // the specific process.
125 std::set<BrokenHostEntry> ran_content_with_cert_errors_hosts_;
117 126
118 // This is a GUID to mark this unique session. Whenever a certificate decision 127 // This is a GUID to mark this unique session. Whenever a certificate decision
119 // expiration is set, the GUID is saved as well so Chrome can tell if it was 128 // expiration is set, the GUID is saved as well so Chrome can tell if it was
120 // last set during the current session. This is used by the 129 // last set during the current session. This is used by the
121 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END experimental group to 130 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END experimental group to
122 // determine if the expired_previous_decision bit should be set on queries. 131 // determine if the expired_previous_decision bit should be set on queries.
123 // 132 //
124 // Why not just iterate over the set of current extensions and mark them all 133 // Why not just iterate over the set of current extensions and mark them all
125 // as expired when the session starts, rather than storing a GUID for the 134 // as expired when the session starts, rather than storing a GUID for the
126 // current session? Glad you asked! Unfortunately, content settings does not 135 // current session? Glad you asked! Unfortunately, content settings does not
127 // currently support iterating over all current *compound* content setting 136 // currently support iterating over all current *compound* content setting
128 // values (iteration only works for simple content settings). While this could 137 // values (iteration only works for simple content settings). While this could
129 // be added, it would be a fair amount of work for what amounts to a temporary 138 // be added, it would be a fair amount of work for what amounts to a temporary
130 // measurement problem, so it's not worth the complexity. 139 // measurement problem, so it's not worth the complexity.
131 // 140 //
132 // TODO(jww): This is only used by the default and disable groups of the 141 // TODO(jww): This is only used by the default and disable groups of the
133 // certificate memory decisions experiment to tell if a decision has expired 142 // certificate memory decisions experiment to tell if a decision has expired
134 // since the last session. Since this is only used for UMA purposes, this 143 // since the last session. Since this is only used for UMA purposes, this
135 // should be removed after the experiment has finished, and a call to Clear() 144 // should be removed after the experiment has finished, and a call to Clear()
136 // should be added to the constructor and destructor for members of the 145 // should be added to the constructor and destructor for members of the
137 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See 146 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See
138 // https://crbug.com/418631 for more details. 147 // https://crbug.com/418631 for more details.
139 const std::string current_expiration_guid_; 148 const std::string current_expiration_guid_;
140 149
141 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); 150 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate);
142 }; 151 };
143 152
144 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ 153 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_
OLDNEW
« no previous file with comments | « android_webview/browser/aw_ssl_host_state_delegate.cc ('k') | chrome/browser/ssl/chrome_ssl_host_state_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698