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

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

Issue 2351113005: [Reland] Refactor WebappRegistry into a singleton instance. (Closed)
Patch Set: Fix WebappModeTest Created 4 years, 3 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
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 67c8df3a5b9f4d079e58ed64c21faa09aba5d7cb..8971a0c8a3e73d6384375034a077cf466295104b 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -699,13 +699,8 @@ void BrowsingDataRemover::RemoveImpl(
}
// Clear the history information (last launch time and origin URL) of any
- // registered webapps. The webapp_registry makes a JNI call into a Java-side
- // AsyncTask, so don't wait for the reply.
- waiting_for_clear_webapp_history_ = true;
- webapp_registry_->ClearWebappHistoryForUrls(
- filter,
- base::Bind(&BrowsingDataRemover::OnClearedWebappHistory,
- weak_ptr_factory_.GetWeakPtr()));
+ // registered webapps.
+ webapp_registry_->ClearWebappHistoryForUrls(filter);
#endif
data_reduction_proxy::DataReductionProxySettings*
@@ -1142,15 +1137,9 @@ void BrowsingDataRemover::RemoveImpl(
}
#if BUILDFLAG(ANDROID_JAVA_UI)
- if (remove_mask & REMOVE_WEBAPP_DATA) {
- // Clear all data associated with registered webapps. The webapp_registry
- // makes a JNI call into a Java-side AsyncTask, so don't wait for the reply.
- waiting_for_clear_webapp_data_ = true;
- webapp_registry_->UnregisterWebappsForUrls(
- filter,
- base::Bind(&BrowsingDataRemover::OnClearedWebappData,
- weak_ptr_factory_.GetWeakPtr()));
- }
+ // Clear all data associated with registered webapps.
+ if (remove_mask & REMOVE_WEBAPP_DATA)
+ webapp_registry_->UnregisterWebappsForUrls(filter);
// For now we're considering offline pages as cache, so if we're removing
// cache we should remove offline pages as well.
@@ -1258,8 +1247,6 @@ bool BrowsingDataRemover::AllDone() {
!waiting_for_clear_pnacl_cache_ &&
#if BUILDFLAG(ANDROID_JAVA_UI)
!waiting_for_clear_precache_history_ &&
- !waiting_for_clear_webapp_data_ &&
- !waiting_for_clear_webapp_history_ &&
!waiting_for_clear_offline_page_data_ &&
#endif
#if defined(ENABLE_WEBRTC)
@@ -1518,18 +1505,6 @@ void BrowsingDataRemover::OnClearedPrecacheHistory() {
NotifyIfDone();
}
-void BrowsingDataRemover::OnClearedWebappData() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- waiting_for_clear_webapp_data_ = false;
- NotifyIfDone();
-}
-
-void BrowsingDataRemover::OnClearedWebappHistory() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- waiting_for_clear_webapp_history_ = false;
- NotifyIfDone();
-}
-
void BrowsingDataRemover::OnClearedOfflinePageData(
offline_pages::OfflinePageModel::DeletePageResult result) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);

Powered by Google App Engine
This is Rietveld 408576698