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

Unified Diff: storage/browser/fileapi/obfuscated_file_util.cc

Issue 602043002: FileSystem: Make SandboxDirectoryDatabase::DestroyDatabase non-static for cleanup (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: remake Created 6 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
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_directory_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4e202ebb68bf9d12779e11e72cf6f869e4d5f250 100644
--- a/storage/browser/fileapi/obfuscated_file_util.cc
+++ b/storage/browser/fileapi/obfuscated_file_util.cc
@@ -922,18 +922,11 @@ bool ObfuscatedFileUtil::DestroyDirectoryDatabase(
if (key.empty())
return true;
DirectoryMap::iterator iter = directories_.find(key);
- if (iter != directories_.end()) {
- SandboxDirectoryDatabase* database = iter->second;
- directories_.erase(iter);
- delete database;
- }
-
- base::File::Error error = base::File::FILE_OK;
- base::FilePath path = GetDirectoryForOriginAndType(
- origin, type_string, false, &error);
- if (path.empty() || error == base::File::FILE_ERROR_NOT_FOUND)
+ if (iter == directories_.end())
return true;
- return SandboxDirectoryDatabase::DestroyDatabase(path, env_override_);
+ scoped_ptr<SandboxDirectoryDatabase> database(iter->second);
+ directories_.erase(iter);
+ return database->DestroyDatabase();
}
// static
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_directory_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698