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

Unified Diff: chrome/browser/android/preferences/pref_service_bridge.cc

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Patch Set: Formatting. Created 4 years, 4 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 | « no previous file | chrome/browser/android/signin/signin_manager_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/preferences/pref_service_bridge.cc
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
index cc3e366db65ebfae72b22ebe718541ad1a835cd2..8d25fcabda20757d57906e36cf14049103f8522d 100644
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -604,9 +604,6 @@ static void ClearBrowsingData(
const JavaParamRef<jobjectArray>& jexcluding_domains) {
BrowsingDataRemover* browsing_data_remover =
BrowsingDataRemoverFactory::GetForBrowserContext(GetOriginalProfile());
- // ClearBrowsingDataObserver deletes itself when |browsing_data_remover| is
- // done.
- new ClearBrowsingDataObserver(env, obj, browsing_data_remover);
std::vector<int> data_types_vector;
base::android::JavaIntArrayToIntVector(env, data_types, &data_types_vector);
@@ -641,10 +638,10 @@ static void ClearBrowsingData(
std::vector<std::string> excluding_domains;
base::android::AppendJavaStringArrayToStringVector(
env, jexcluding_domains.obj(), &excluding_domains);
- RegistrableDomainFilterBuilder filter_builder(
- BrowsingDataFilterBuilder::BLACKLIST);
+ std::unique_ptr<RegistrableDomainFilterBuilder> filter_builder(
+ new RegistrableDomainFilterBuilder(BrowsingDataFilterBuilder::BLACKLIST));
for (const std::string& domain : excluding_domains) {
- filter_builder.AddRegisterableDomain(domain);
+ filter_builder->AddRegisterableDomain(domain);
}
if (!excluding_domains.empty()) {
@@ -652,10 +649,16 @@ static void ClearBrowsingData(
excluding_domains);
}
- browsing_data_remover->RemoveWithFilter(
+ // ClearBrowsingDataObserver deletes itself when |browsing_data_remover| is
+ // done.
+ ClearBrowsingDataObserver* observer =
+ new ClearBrowsingDataObserver(env, obj, browsing_data_remover);
+
+ browsing_data_remover->RemoveWithFilterAndReply(
BrowsingDataRemover::Period(
static_cast<browsing_data::TimePeriod>(time_period)),
- remove_mask, BrowsingDataHelper::UNPROTECTED_WEB, filter_builder);
+ remove_mask, BrowsingDataHelper::UNPROTECTED_WEB,
+ std::move(filter_builder), observer);
}
static jboolean CanDeleteBrowsingHistory(JNIEnv* env,
« no previous file with comments | « no previous file | chrome/browser/android/signin/signin_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698