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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 2097043002: Clear HTTP auth data on clearing browsing data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clear auth data directly from BrowsingDataRemover Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | net/http/http_auth_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover.cc
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc
index c58ab51a4923239b8d8d0f3ea16a5e224ae75b50..b6885f27276518e137b13a0c5822204124f4f2ca 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -72,6 +72,8 @@
#include "content/public/browser/user_metrics.h"
#include "net/base/net_errors.h"
#include "net/cookies/cookie_store.h"
+#include "net/http/http_network_session.h"
+#include "net/http/http_transaction_factory.h"
#include "net/http/transport_security_state.h"
#include "net/ssl/channel_id_service.h"
#include "net/ssl/channel_id_store.h"
@@ -183,6 +185,19 @@ void ClearHostnameResolutionCacheOnIOThread(IOThread* io_thread) {
io_thread->ClearHostCache();
}
+void ClearHttpAuthCacheOnIOThread(
+ scoped_refptr<net::URLRequestContextGetter> context_getter,
+ base::Time delete_begin,
+ base::Time delete_end) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ net::HttpNetworkSession* http_session = context_getter->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetSession();
+ DCHECK(http_session);
+ http_session->http_auth_cache()->Clear(delete_begin, delete_end);
+}
+
void ClearNetworkPredictorOnIOThread(chrome_browser_net::Predictor* predictor) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(predictor);
@@ -900,6 +915,20 @@ void BrowsingDataRemover::RemoveImpl(
weak_ptr_factory_.GetWeakPtr()));
}
+ if (remove_mask & REMOVE_CACHE || remove_mask & REMOVE_COOKIES ||
+ remove_mask & REMOVE_PASSWORDS && g_browser_process->io_thread()) {
msramek 2016/07/01 13:19:40 The g_browser_process->io_thread() is not necessar
Tomasz Moniuszko 2016/07/01 14:54:40 Done.
+ scoped_refptr<net::URLRequestContextGetter> request_context =
msramek 2016/07/01 13:19:40 This is not really related to storage partition, s
Tomasz Moniuszko 2016/07/01 14:54:40 Done.
+ content::BrowserContext::GetDefaultStoragePartition(profile_)
+ ->GetURLRequestContext();
+ waiting_for_clear_http_auth_cache_ = true;
+ BrowserThread::PostTaskAndReply(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&ClearHttpAuthCacheOnIOThread, std::move(request_context),
+ delete_begin_, delete_end_),
+ base::Bind(&BrowsingDataRemover::OnClearedHttpAuthCache,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
+
if (remove_mask & REMOVE_WEBRTC_IDENTITY) {
storage_partition_remove_mask |=
content::StoragePartition::REMOVE_DATA_MASK_WEBRTC_IDENTITY;
@@ -1108,6 +1137,7 @@ bool BrowsingDataRemover::AllDone() {
!waiting_for_clear_domain_reliability_monitor_ &&
!waiting_for_clear_form_ && !waiting_for_clear_history_ &&
!waiting_for_clear_hostname_resolution_cache_ &&
+ !waiting_for_clear_http_auth_cache_ &&
!waiting_for_clear_keyword_data_ && !waiting_for_clear_nacl_cache_ &&
!waiting_for_clear_network_predictor_ &&
!waiting_for_clear_networking_history_ &&
@@ -1180,6 +1210,12 @@ void BrowsingDataRemover::OnClearedHostnameResolutionCache() {
NotifyIfDone();
}
+void BrowsingDataRemover::OnClearedHttpAuthCache() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ waiting_for_clear_http_auth_cache_ = false;
+ NotifyIfDone();
+}
+
void BrowsingDataRemover::OnClearedNetworkPredictor() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
waiting_for_clear_network_predictor_ = false;
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | net/http/http_auth_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698