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

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

Issue 1459473003: Add a WebContents getter callback in ResourceRequestInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed David's comments Created 5 years 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.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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 void SSLPolicy::OnCertErrorInternal(SSLCertErrorHandler* handler, 226 void SSLPolicy::OnCertErrorInternal(SSLCertErrorHandler* handler,
227 int options_mask) { 227 int options_mask) {
228 bool overridable = (options_mask & OVERRIDABLE) != 0; 228 bool overridable = (options_mask & OVERRIDABLE) != 0;
229 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0; 229 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0;
230 bool expired_previous_decision = 230 bool expired_previous_decision =
231 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0; 231 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0;
232 CertificateRequestResultType result = 232 CertificateRequestResultType result =
233 CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE; 233 CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE;
234 GetContentClient()->browser()->AllowCertificateError( 234 GetContentClient()->browser()->AllowCertificateError(
235 handler->render_process_id(), 235 handler->manager()->controller()->GetWebContents(), handler->cert_error(),
236 handler->render_frame_id(), 236 handler->ssl_info(), handler->request_url(), handler->resource_type(),
237 handler->cert_error(), 237 overridable, strict_enforcement, expired_previous_decision,
238 handler->ssl_info(), 238 base::Bind(&SSLPolicy::OnAllowCertificate, base::Unretained(this),
239 handler->request_url(),
240 handler->resource_type(),
241 overridable,
242 strict_enforcement,
243 expired_previous_decision,
244 base::Bind(&SSLPolicy::OnAllowCertificate,
245 base::Unretained(this),
246 make_scoped_refptr(handler)), 239 make_scoped_refptr(handler)),
247 &result); 240 &result);
248 switch (result) { 241 switch (result) {
249 case CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE: 242 case CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE:
250 break; 243 break;
251 case CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL: 244 case CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL:
252 handler->CancelRequest(); 245 handler->CancelRequest();
253 break; 246 break;
254 case CERTIFICATE_REQUEST_RESULT_TYPE_DENY: 247 case CERTIFICATE_REQUEST_RESULT_TYPE_DENY:
255 handler->DenyRequest(); 248 handler->DenyRequest();
(...skipping 11 matching lines...) Expand all
267 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); 260 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status);
268 } 261 }
269 262
270 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { 263 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) {
271 GURL parsed_origin(origin); 264 GURL parsed_origin(origin);
272 if (parsed_origin.SchemeIsCryptographic()) 265 if (parsed_origin.SchemeIsCryptographic())
273 backend_->HostRanInsecureContent(parsed_origin.host(), pid); 266 backend_->HostRanInsecureContent(parsed_origin.host(), pid);
274 } 267 }
275 268
276 } // namespace content 269 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698