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