| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "content/public/browser/browser_thread.h" | 68 #include "content/public/browser/browser_thread.h" |
| 69 #include "content/public/browser/dom_storage_context.h" | 69 #include "content/public/browser/dom_storage_context.h" |
| 70 #include "content/public/browser/download_manager.h" | 70 #include "content/public/browser/download_manager.h" |
| 71 #include "content/public/browser/local_storage_usage_info.h" | 71 #include "content/public/browser/local_storage_usage_info.h" |
| 72 #include "content/public/browser/notification_service.h" | 72 #include "content/public/browser/notification_service.h" |
| 73 #include "content/public/browser/plugin_data_remover.h" | 73 #include "content/public/browser/plugin_data_remover.h" |
| 74 #include "content/public/browser/session_storage_usage_info.h" | 74 #include "content/public/browser/session_storage_usage_info.h" |
| 75 #include "content/public/browser/storage_partition.h" | 75 #include "content/public/browser/storage_partition.h" |
| 76 #include "content/public/browser/user_metrics.h" | 76 #include "content/public/browser/user_metrics.h" |
| 77 #include "net/base/net_errors.h" | 77 #include "net/base/net_errors.h" |
| 78 #include "net/base/sdch_manager.h" | |
| 79 #include "net/cookies/cookie_store.h" | 78 #include "net/cookies/cookie_store.h" |
| 80 #include "net/disk_cache/disk_cache.h" | 79 #include "net/disk_cache/disk_cache.h" |
| 81 #include "net/http/http_cache.h" | 80 #include "net/http/http_cache.h" |
| 82 #include "net/http/transport_security_state.h" | 81 #include "net/http/transport_security_state.h" |
| 83 #include "net/ssl/server_bound_cert_service.h" | 82 #include "net/ssl/server_bound_cert_service.h" |
| 84 #include "net/ssl/server_bound_cert_store.h" | 83 #include "net/ssl/server_bound_cert_store.h" |
| 85 #include "net/url_request/url_request_context.h" | 84 #include "net/url_request/url_request_context.h" |
| 86 #include "net/url_request/url_request_context_getter.h" | 85 #include "net/url_request/url_request_context_getter.h" |
| 87 #include "webkit/browser/quota/quota_manager.h" | 86 #include "webkit/browser/quota/quota_manager.h" |
| 88 #include "webkit/browser/quota/special_storage_policy.h" | 87 #include "webkit/browser/quota/special_storage_policy.h" |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 net::HttpCache* http_cache = | 922 net::HttpCache* http_cache = |
| 924 getter->GetURLRequestContext()->http_transaction_factory()-> | 923 getter->GetURLRequestContext()->http_transaction_factory()-> |
| 925 GetCache(); | 924 GetCache(); |
| 926 | 925 |
| 927 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? | 926 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? |
| 928 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; | 927 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; |
| 929 | 928 |
| 930 // Clear QUIC server information from memory and the disk cache. | 929 // Clear QUIC server information from memory and the disk cache. |
| 931 http_cache->GetSession()->quic_stream_factory()-> | 930 http_cache->GetSession()->quic_stream_factory()-> |
| 932 ClearCachedStatesInCryptoConfig(); | 931 ClearCachedStatesInCryptoConfig(); |
| 933 | |
| 934 // Clear SDCH dictionary state. | |
| 935 net::SdchManager* sdch_manager = | |
| 936 getter->GetURLRequestContext()->sdch_manager(); | |
| 937 // The test is probably overkill, since chrome should always have an | |
| 938 // SdchManager. But in general the URLRequestContext is *not* | |
| 939 // guaranteed to have an SdchManager, so checking is wise. | |
| 940 if (sdch_manager) | |
| 941 sdch_manager->ClearData(); | |
| 942 | |
| 943 rv = http_cache->GetBackend( | 932 rv = http_cache->GetBackend( |
| 944 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache, | 933 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache, |
| 945 base::Unretained(this))); | 934 base::Unretained(this))); |
| 946 break; | 935 break; |
| 947 } | 936 } |
| 948 case STATE_DELETE_MAIN: | 937 case STATE_DELETE_MAIN: |
| 949 case STATE_DELETE_MEDIA: { | 938 case STATE_DELETE_MEDIA: { |
| 950 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? | 939 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? |
| 951 STATE_CREATE_MEDIA : STATE_DONE; | 940 STATE_CREATE_MEDIA : STATE_DONE; |
| 952 | 941 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 waiting_for_clear_webrtc_logs_ = false; | 1146 waiting_for_clear_webrtc_logs_ = false; |
| 1158 NotifyAndDeleteIfDone(); | 1147 NotifyAndDeleteIfDone(); |
| 1159 } | 1148 } |
| 1160 #endif | 1149 #endif |
| 1161 | 1150 |
| 1162 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1151 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1163 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1152 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1164 waiting_for_clear_domain_reliability_monitor_ = false; | 1153 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1165 NotifyAndDeleteIfDone(); | 1154 NotifyAndDeleteIfDone(); |
| 1166 } | 1155 } |
| OLD | NEW |