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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 255783002: QUIC - Minor clean up of QUIC Server Info memory cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed wtc's comments in Patch Set 2 Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/quic/crypto/quic_crypto_client_config.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 "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 892
893 while (rv != net::ERR_IO_PENDING && next_cache_state_ != STATE_NONE) { 893 while (rv != net::ERR_IO_PENDING && next_cache_state_ != STATE_NONE) {
894 switch (next_cache_state_) { 894 switch (next_cache_state_) {
895 case STATE_CREATE_MAIN: 895 case STATE_CREATE_MAIN:
896 case STATE_CREATE_MEDIA: { 896 case STATE_CREATE_MEDIA: {
897 // Get a pointer to the cache. 897 // Get a pointer to the cache.
898 net::URLRequestContextGetter* getter = 898 net::URLRequestContextGetter* getter =
899 (next_cache_state_ == STATE_CREATE_MAIN) 899 (next_cache_state_ == STATE_CREATE_MAIN)
900 ? main_context_getter_.get() 900 ? main_context_getter_.get()
901 : media_context_getter_.get(); 901 : media_context_getter_.get();
902 net::HttpTransactionFactory* factory = 902 net::HttpCache* http_cache =
903 getter->GetURLRequestContext()->http_transaction_factory(); 903 getter->GetURLRequestContext()->http_transaction_factory()->
904 904 GetCache();
905 // Clear QUIC server information from memory.
906 net::HttpCache* http_cache = factory->GetCache();
907 http_cache->GetSession()->quic_stream_factory()->ClearCachedStates();
908 905
909 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? 906 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ?
910 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; 907 STATE_DELETE_MAIN : STATE_DELETE_MEDIA;
911 908
909 // Clear QUIC server information from memory and the disk cache.
910 http_cache->GetSession()->quic_stream_factory()->
911 ClearCachedStatesInCryptoConfig();
912 rv = http_cache->GetBackend( 912 rv = http_cache->GetBackend(
913 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache, 913 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache,
914 base::Unretained(this))); 914 base::Unretained(this)));
915 break; 915 break;
916 } 916 }
917 case STATE_DELETE_MAIN: 917 case STATE_DELETE_MAIN:
918 case STATE_DELETE_MEDIA: { 918 case STATE_DELETE_MEDIA: {
919 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? 919 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ?
920 STATE_CREATE_MEDIA : STATE_DONE; 920 STATE_CREATE_MEDIA : STATE_DONE;
921 921
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 NotifyAndDeleteIfDone(); 1120 NotifyAndDeleteIfDone();
1121 } 1121 }
1122 1122
1123 #if defined(ENABLE_WEBRTC) 1123 #if defined(ENABLE_WEBRTC)
1124 void BrowsingDataRemover::OnClearedWebRtcLogs() { 1124 void BrowsingDataRemover::OnClearedWebRtcLogs() {
1125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1126 waiting_for_clear_webrtc_logs_ = false; 1126 waiting_for_clear_webrtc_logs_ = false;
1127 NotifyAndDeleteIfDone(); 1127 NotifyAndDeleteIfDone();
1128 } 1128 }
1129 #endif 1129 #endif
OLDNEW
« no previous file with comments | « no previous file | net/quic/crypto/quic_crypto_client_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698