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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 net::HttpCache* http_cache = | 923 net::HttpCache* http_cache = |
923 getter->GetURLRequestContext()->http_transaction_factory()-> | 924 getter->GetURLRequestContext()->http_transaction_factory()-> |
924 GetCache(); | 925 GetCache(); |
925 | 926 |
926 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? | 927 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? |
927 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; | 928 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; |
928 | 929 |
929 // Clear QUIC server information from memory and the disk cache. | 930 // Clear QUIC server information from memory and the disk cache. |
930 http_cache->GetSession()->quic_stream_factory()-> | 931 http_cache->GetSession()->quic_stream_factory()-> |
931 ClearCachedStatesInCryptoConfig(); | 932 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 |
932 rv = http_cache->GetBackend( | 943 rv = http_cache->GetBackend( |
933 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache, | 944 &cache_, base::Bind(&BrowsingDataRemover::DoClearCache, |
934 base::Unretained(this))); | 945 base::Unretained(this))); |
935 break; | 946 break; |
936 } | 947 } |
937 case STATE_DELETE_MAIN: | 948 case STATE_DELETE_MAIN: |
938 case STATE_DELETE_MEDIA: { | 949 case STATE_DELETE_MEDIA: { |
939 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? | 950 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? |
940 STATE_CREATE_MEDIA : STATE_DONE; | 951 STATE_CREATE_MEDIA : STATE_DONE; |
941 | 952 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 waiting_for_clear_webrtc_logs_ = false; | 1157 waiting_for_clear_webrtc_logs_ = false; |
1147 NotifyAndDeleteIfDone(); | 1158 NotifyAndDeleteIfDone(); |
1148 } | 1159 } |
1149 #endif | 1160 #endif |
1150 | 1161 |
1151 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1162 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
1152 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1163 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1153 waiting_for_clear_domain_reliability_monitor_ = false; | 1164 waiting_for_clear_domain_reliability_monitor_ = false; |
1154 NotifyAndDeleteIfDone(); | 1165 NotifyAndDeleteIfDone(); |
1155 } | 1166 } |
OLD | NEW |