Index: storage/browser/fileapi/obfuscated_file_util.cc |
diff --git a/storage/browser/fileapi/obfuscated_file_util.cc b/storage/browser/fileapi/obfuscated_file_util.cc |
index 8c02dd11bf4a18e2fbcbd7ab2bdc0edbd6b6a1ca..58c0fe1759665414d3cd3f0c669564e9a7cf2fa4 100644 |
--- a/storage/browser/fileapi/obfuscated_file_util.cc |
+++ b/storage/browser/fileapi/obfuscated_file_util.cc |
@@ -874,23 +874,35 @@ bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType( |
return false; |
} |
+ if (type_string.empty()) { |
+ // The |origin_type_path| is the topmost origin directory if |type_string| |
+ // is empty. We should have already deleted that directory. |
+ // Now clear the database and we are done. |
+ InitOriginDatabase(origin, false); |
+ if (origin_database_) { |
+ if (!origin_database_->RemovePathForOrigin( |
+ storage::GetIdentifierFromOrigin(origin))) { |
+ LOG(WARNING) << "Cannot remove path from origin database."; |
+ } |
+ } |
+ return true; |
+ } |
+ |
base::FilePath origin_path = VirtualPath::DirName(origin_type_path); |
DCHECK_EQ(origin_path.value(), |
GetDirectoryForOrigin(origin, false, NULL).value()); |
- if (!type_string.empty()) { |
- // At this point we are sure we had successfully deleted the origin/type |
- // directory (i.e. we're ready to just return true). |
- // See if we have other directories in this origin directory. |
- for (std::set<std::string>::iterator iter = known_type_strings_.begin(); |
- iter != known_type_strings_.end(); |
- ++iter) { |
- if (*iter == type_string) |
- continue; |
- if (base::DirectoryExists(origin_path.AppendASCII(*iter))) { |
- // Other type's directory exists; just return true here. |
- return true; |
- } |
+ // At this point we are sure we had successfully deleted the origin/type |
+ // directory (i.e. we're ready to just return true). |
+ // See if we have other directories in this origin directory. |
+ for (std::set<std::string>::iterator iter = known_type_strings_.begin(); |
+ iter != known_type_strings_.end(); |
+ ++iter) { |
+ if (*iter == type_string) |
+ continue; |
+ if (base::DirectoryExists(origin_path.AppendASCII(*iter))) { |
+ // Other type's directory exists; just return true here. |
+ return true; |
} |
} |