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

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

Issue 2863623003: [DevTools] Support multiple sessions in content/ domain handlers (Closed)
Patch Set: Created 3 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
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_manager.h" 5 #include "content/browser/ssl/ssl_manager.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 const net::SSLInfo& ssl_info = handler->ssl_info(); 376 const net::SSLInfo& ssl_info = handler->ssl_info();
377 const GURL& request_url = handler->request_url(); 377 const GURL& request_url = handler->request_url();
378 ResourceType resource_type = handler->resource_type(); 378 ResourceType resource_type = handler->resource_type();
379 379
380 base::Callback<void(bool, content::CertificateRequestResultType)> callback = 380 base::Callback<void(bool, content::CertificateRequestResultType)> callback =
381 base::Bind(&OnAllowCertificate, base::Owned(handler.release()), 381 base::Bind(&OnAllowCertificate, base::Owned(handler.release()),
382 ssl_host_state_delegate_); 382 ssl_host_state_delegate_);
383 383
384 DevToolsAgentHostImpl* agent_host = static_cast<DevToolsAgentHostImpl*>( 384 DevToolsAgentHostImpl* agent_host = static_cast<DevToolsAgentHostImpl*>(
385 DevToolsAgentHost::GetOrCreateFor(web_contents).get()); 385 DevToolsAgentHost::GetOrCreateFor(web_contents).get());
386 protocol::SecurityHandler* security_handler = 386 if (agent_host) {
387 protocol::SecurityHandler::FromAgentHost(agent_host); 387 for (auto* handler : protocol::SecurityHandler::ForAgentHost(agent_host)) {
caseq 2017/05/05 18:27:24 Let's pick a different name so as not to shadow fu
dgozman 2017/05/05 20:29:42 Done.
388 if (!security_handler || 388 if (handler->NotifyCertificateError(
389 !security_handler->NotifyCertificateError( 389 cert_error, request_url,
390 cert_error, request_url, 390 base::Bind(&OnAllowCertificateWithRecordDecision, false,
391 base::Bind(&OnAllowCertificateWithRecordDecision, false, callback))) { 391 callback))) {
392 GetContentClient()->browser()->AllowCertificateError( 392 return;
393 web_contents, cert_error, ssl_info, request_url, resource_type, 393 }
394 overridable, strict_enforcement, expired_previous_decision, 394 }
395 base::Bind(&OnAllowCertificateWithRecordDecision, true, callback));
396 } 395 }
396
397 GetContentClient()->browser()->AllowCertificateError(
398 web_contents, cert_error, ssl_info, request_url, resource_type,
399 overridable, strict_enforcement, expired_previous_decision,
400 base::Bind(&OnAllowCertificateWithRecordDecision, true, callback));
397 } 401 }
398 402
399 void SSLManager::UpdateEntry(NavigationEntryImpl* entry, 403 void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
400 int add_content_status_flags, 404 int add_content_status_flags,
401 int remove_content_status_flags) { 405 int remove_content_status_flags) {
402 // We don't always have a navigation entry to update, for example in the 406 // We don't always have a navigation entry to update, for example in the
403 // case of the Web Inspector. 407 // case of the Web Inspector.
404 if (!entry) 408 if (!entry)
405 return; 409 return;
406 410
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 SSLManagerSet* managers = 458 SSLManagerSet* managers =
455 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName)); 459 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName));
456 460
457 for (std::set<SSLManager*>::iterator i = managers->get().begin(); 461 for (std::set<SSLManager*>::iterator i = managers->get().begin();
458 i != managers->get().end(); ++i) { 462 i != managers->get().end(); ++i) {
459 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0); 463 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0);
460 } 464 }
461 } 465 }
462 466
463 } // namespace content 467 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698