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

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

Issue 2863623003: [DevTools] Support multiple sessions in content/ domain handlers (Closed)
Patch Set: addressed review comments 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
« no previous file with comments | « content/browser/devtools/worker_devtools_agent_host.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_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* security_handler :
388 if (!security_handler || 388 protocol::SecurityHandler::ForAgentHost(agent_host)) {
389 !security_handler->NotifyCertificateError( 389 if (security_handler->NotifyCertificateError(
390 cert_error, request_url, 390 cert_error, request_url,
391 base::Bind(&OnAllowCertificateWithRecordDecision, false, callback))) { 391 base::Bind(&OnAllowCertificateWithRecordDecision, false,
392 GetContentClient()->browser()->AllowCertificateError( 392 callback))) {
393 web_contents, cert_error, ssl_info, request_url, resource_type, 393 return;
394 overridable, strict_enforcement, expired_previous_decision, 394 }
395 base::Bind(&OnAllowCertificateWithRecordDecision, true, callback)); 395 }
396 } 396 }
397
398 GetContentClient()->browser()->AllowCertificateError(
399 web_contents, cert_error, ssl_info, request_url, resource_type,
400 overridable, strict_enforcement, expired_previous_decision,
401 base::Bind(&OnAllowCertificateWithRecordDecision, true, callback));
397 } 402 }
398 403
399 void SSLManager::UpdateEntry(NavigationEntryImpl* entry, 404 void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
400 int add_content_status_flags, 405 int add_content_status_flags,
401 int remove_content_status_flags) { 406 int remove_content_status_flags) {
402 // We don't always have a navigation entry to update, for example in the 407 // We don't always have a navigation entry to update, for example in the
403 // case of the Web Inspector. 408 // case of the Web Inspector.
404 if (!entry) 409 if (!entry)
405 return; 410 return;
406 411
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 SSLManagerSet* managers = 459 SSLManagerSet* managers =
455 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName)); 460 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName));
456 461
457 for (std::set<SSLManager*>::iterator i = managers->get().begin(); 462 for (std::set<SSLManager*>::iterator i = managers->get().begin();
458 i != managers->get().end(); ++i) { 463 i != managers->get().end(); ++i) {
459 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0); 464 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0);
460 } 465 }
461 } 466 }
462 467
463 } // namespace content 468 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/worker_devtools_agent_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698