Index: content/browser/plugin_private_storage_helper.cc |
diff --git a/content/browser/plugin_private_storage_helper.cc b/content/browser/plugin_private_storage_helper.cc |
index 86278c0409ea125a5529b411140f7d3017e2c5c1..a84f6580daa4dc56a1bca862d8742ee1afe93e8c 100644 |
--- a/content/browser/plugin_private_storage_helper.cc |
+++ b/content/browser/plugin_private_storage_helper.cc |
@@ -112,6 +112,9 @@ class PluginPrivateDataByOriginChecker { |
// Keep track if the data for this origin needs to be deleted due to |
// any file found that has last modified time between |begin_| and |end_|. |
bool delete_this_origin_data_ = false; |
+ |
+ // Keep track if any files exist for this origin. |
+ bool files_found_ = false; |
}; |
void PluginPrivateDataByOriginChecker::CheckFilesOnIOThread() { |
@@ -168,6 +171,10 @@ void PluginPrivateDataByOriginChecker::OnDirectoryRead( |
return; |
} |
+ // If there are files found, keep track of it. |
+ if (!file_list.empty()) |
+ files_found_ = true; |
+ |
// No error, process the files returned. No need to do this if we have |
// already decided to delete all the data for this origin. |
if (!delete_this_origin_data_) { |
@@ -228,6 +235,10 @@ void PluginPrivateDataByOriginChecker::DecrementTaskCount() { |
if (task_count_) |
return; |
+ // If no files exist for this origin, then we can safely delete it. |
+ if (!files_found_) |
+ delete_this_origin_data_ = true; |
+ |
// If there are no more tasks in progress, then run |callback_| on the |
// proper thread. |
filesystem_context_->default_file_task_runner()->PostTask( |