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

Side by Side Diff: net/spdy/spdy_session_pool.cc

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Rebased Created 4 years, 2 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 | « net/spdy/spdy_session_pool.h ('k') | net/ssl/ssl_client_auth_cache.h » ('j') | 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 "net/spdy/spdy_session_pool.h" 5 #include "net/spdy/spdy_session_pool.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) 351 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS)
352 DCHECK(!IsSessionAvailable(*it)); 352 DCHECK(!IsSessionAvailable(*it));
353 } 353 }
354 http_server_properties_->ClearAllSpdySettings(); 354 http_server_properties_->ClearAllSpdySettings();
355 } 355 }
356 356
357 void SpdySessionPool::OnSSLConfigChanged() { 357 void SpdySessionPool::OnSSLConfigChanged() {
358 CloseCurrentSessions(ERR_NETWORK_CHANGED); 358 CloseCurrentSessions(ERR_NETWORK_CHANGED);
359 } 359 }
360 360
361 void SpdySessionPool::OnCertAdded(const X509Certificate* cert) { 361 void SpdySessionPool::OnCertDBChanged(const X509Certificate* cert) {
362 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED); 362 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED);
363 } 363 }
364 364
365 void SpdySessionPool::OnCACertChanged(const X509Certificate* cert) {
366 // Per wtc, we actually only need to CloseCurrentSessions when trust is
367 // reduced. CloseCurrentSessions now because OnCACertChanged does not
368 // tell us this.
369 // See comments in ClientSocketPoolManager::OnCACertChanged.
370 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED);
371 }
372
373 bool SpdySessionPool::IsSessionAvailable( 365 bool SpdySessionPool::IsSessionAvailable(
374 const base::WeakPtr<SpdySession>& session) const { 366 const base::WeakPtr<SpdySession>& session) const {
375 for (AvailableSessionMap::const_iterator it = available_sessions_.begin(); 367 for (AvailableSessionMap::const_iterator it = available_sessions_.begin();
376 it != available_sessions_.end(); ++it) { 368 it != available_sessions_.end(); ++it) {
377 if (it->second.get() == session.get()) 369 if (it->second.get() == session.get())
378 return true; 370 return true;
379 } 371 }
380 return false; 372 return false;
381 } 373 }
382 374
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 428
437 if (idle_only && (*it)->is_active()) 429 if (idle_only && (*it)->is_active())
438 continue; 430 continue;
439 431
440 (*it)->CloseSessionOnError(error, description); 432 (*it)->CloseSessionOnError(error, description);
441 DCHECK(!IsSessionAvailable(*it)); 433 DCHECK(!IsSessionAvailable(*it));
442 } 434 }
443 } 435 }
444 436
445 } // namespace net 437 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_pool.h ('k') | net/ssl/ssl_client_auth_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698