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

Side by Side Diff: net/socket/client_socket_pool_manager_impl.cc

Issue 27500004: Listen for new system certificates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review. Created 7 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 | Annotate | Revision Log
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/socket/client_socket_pool_manager_impl.h" 5 #include "net/socket/client_socket_pool_manager_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "net/http/http_network_session.h" 9 #include "net/http/http_network_session.h"
10 #include "net/http/http_proxy_client_socket_pool.h" 10 #include "net/http/http_proxy_client_socket_pool.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // Third parameter is false because |ssl_socket_pools_for_proxies_| use 364 // Third parameter is false because |ssl_socket_pools_for_proxies_| use
365 // socket pools in |http_proxy_socket_pools_| and |socks_socket_pools_|. 365 // socket pools in |http_proxy_socket_pools_| and |socks_socket_pools_|.
366 AddSocketPoolsToList(list, 366 AddSocketPoolsToList(list,
367 ssl_socket_pools_for_proxies_, 367 ssl_socket_pools_for_proxies_,
368 "ssl_socket_pool_for_proxies", 368 "ssl_socket_pool_for_proxies",
369 false); 369 false);
370 return list; 370 return list;
371 } 371 }
372 372
373 void ClientSocketPoolManagerImpl::OnCertAdded(const X509Certificate* cert) { 373 void ClientSocketPoolManagerImpl::OnCertAdded(const X509Certificate* cert) {
374 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); 374 OnDatabaseChanged();
375 } 375 }
376 376
377 void ClientSocketPoolManagerImpl::OnCertTrustChanged( 377 void ClientSocketPoolManagerImpl::OnCertTrustChanged(
378 const X509Certificate* cert) { 378 const X509Certificate* cert) {
379 // We should flush the socket pools if we removed trust from a 379 // We should flush the socket pools if we removed trust from a
380 // cert, because a previously trusted server may have become 380 // cert, because a previously trusted server may have become
381 // untrusted. 381 // untrusted.
382 // 382 //
383 // We should not flush the socket pools if we added trust to a 383 // We should not flush the socket pools if we added trust to a
384 // cert. 384 // cert.
385 // 385 //
386 // Since the OnCertTrustChanged method doesn't tell us what 386 // Since the OnCertTrustChanged method doesn't tell us what
387 // kind of trust change it is, we have to flush the socket 387 // kind of trust change it is, we have to flush the socket
388 // pools to be safe. 388 // pools to be safe.
389 OnDatabaseChanged();
390 }
391
392 void ClientSocketPoolManagerImpl::OnDatabaseChanged() {
393 // We should flush the socket pools if we removed trust from a
394 // cert, because a previously trusted server may have become
395 // untrusted.
396 //
397 // We should not flush the socket pools if we added trust to a
398 // cert.
399 //
400 // Since the OnDatabaseChanged method doesn't tell us what
401 // kind of trust change it is, we have to flush the socket
402 // pools to be safe.
389 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); 403 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED);
390 } 404 }
391 405
392 } // namespace net 406 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698