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

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

Issue 2248403002: Implement origin-based deletion of plugin data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. 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
Index: chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc
diff --git a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc b/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc
index baeb4bd5732f9f63da2cd58714cecc98c59588f5..a71ca51dea2c12551fdef5eeb99b643bf8ff8fb2 100644
--- a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc
@@ -25,7 +25,8 @@ class BrowsingDataFlashLSOHelperImpl
// BrowsingDataFlashLSOHelper implementation:
void StartFetching(const GetSitesWithFlashDataCallback& callback) override;
- void DeleteFlashLSOsForSite(const std::string& site) override;
+ void DeleteFlashLSOsForSite(const std::string& site,
+ const base::Closure& callback) override;
// PepperFlashSettingsManager::Client overrides:
void OnGetSitesWithDataCompleted(
@@ -34,6 +35,15 @@ class BrowsingDataFlashLSOHelperImpl
void OnClearSiteDataCompleted(uint32_t request_id, bool success) override;
private:
+ struct DeleteFlashLSOTask {
+ DeleteFlashLSOTask() {}
+ DeleteFlashLSOTask(const std::string& site, const base::Closure& callback)
+ : site(site), callback(callback) {}
+
+ std::string site;
+ base::Closure callback;
+ };
+
~BrowsingDataFlashLSOHelperImpl() override;
// Asynchronously fetches and deletes data and calls us back.
@@ -43,8 +53,9 @@ class BrowsingDataFlashLSOHelperImpl
uint32_t get_sites_with_data_request_id_;
// Contains the pending requests to clear site data. The key is the request
- // ID, the value the site for which to clear data.
- std::map<uint32_t, std::string> clear_site_data_ids_;
+ // ID, the value is the site for which to clear data and the callback to be
+ // called upon completion.
+ std::map<uint32_t, DeleteFlashLSOTask> clear_site_data_ids_;
// Called when we have fetched the list of sites.
GetSitesWithFlashDataCallback callback_;
@@ -69,11 +80,11 @@ void BrowsingDataFlashLSOHelperImpl::StartFetching(
}
void BrowsingDataFlashLSOHelperImpl::DeleteFlashLSOsForSite(
- const std::string& site) {
+ const std::string& site, const base::Closure& callback) {
const uint64_t kClearAllData = 0;
uint32_t id = settings_manager_.ClearSiteData(
site, kClearAllData, std::numeric_limits<uint64_t>::max());
- clear_site_data_ids_[id] = site;
+ clear_site_data_ids_[id] = DeleteFlashLSOTask(site, callback);
}
void BrowsingDataFlashLSOHelperImpl::OnGetSitesWithDataCompleted(
@@ -87,11 +98,13 @@ void BrowsingDataFlashLSOHelperImpl::OnGetSitesWithDataCompleted(
void BrowsingDataFlashLSOHelperImpl::OnClearSiteDataCompleted(
uint32_t request_id,
bool success) {
- std::map<uint32_t, std::string>::iterator entry =
+ std::map<uint32_t, DeleteFlashLSOTask>::iterator entry =
clear_site_data_ids_.find(request_id);
DCHECK(entry != clear_site_data_ids_.end());
LOG_IF(ERROR, !success) << "Couldn't clear Flash LSO data for "
- << entry->second;
+ << entry->second.site;
+ if (!entry->second.callback.is_null())
+ entry->second.callback.Run();
clear_site_data_ids_.erase(entry);
}
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_flash_lso_helper.h ('k') | chrome/browser/browsing_data/browsing_data_remover.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698