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

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

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

Powered by Google App Engine
This is Rietveld 408576698