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

Unified Diff: content/browser/indexed_db/indexed_db_backing_store.cc

Issue 1757693002: Reduce use of DatabaseIdentifier in Indexed DB entry points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert change for ZIP file naming Created 4 years, 10 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: content/browser/indexed_db/indexed_db_backing_store.cc
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc
index 8e356fceaccb1858d1e9d57438e9cd21453322c8..641245ce7d7ac8d5b1eb8c4520db2aabdf254120 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store.cc
@@ -22,6 +22,7 @@
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/indexed_db/indexed_db_blob_info.h"
#include "content/browser/indexed_db/indexed_db_class_factory.h"
+#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
#include "content/browser/indexed_db/indexed_db_metadata.h"
@@ -88,20 +89,8 @@ static std::string ComputeOriginIdentifier(const GURL& origin_url) {
return storage::GetIdentifierFromOrigin(origin_url) + "@1";
}
-static base::FilePath ComputeFileName(const GURL& origin_url) {
- return base::FilePath()
- .AppendASCII(storage::GetIdentifierFromOrigin(origin_url))
- .AddExtension(FILE_PATH_LITERAL(".indexeddb.leveldb"));
-}
-
-static base::FilePath ComputeBlobPath(const GURL& origin_url) {
- return base::FilePath()
- .AppendASCII(storage::GetIdentifierFromOrigin(origin_url))
- .AddExtension(FILE_PATH_LITERAL(".indexeddb.blob"));
-}
-
-static base::FilePath ComputeCorruptionFileName(const GURL& origin_url) {
- return ComputeFileName(origin_url)
+static FilePath ComputeCorruptionFileName(const GURL& origin_url) {
+ return IndexedDBContextImpl::GetLevelDBFileName(origin_url)
.Append(FILE_PATH_LITERAL("corruption_info.json"));
}
@@ -909,7 +898,7 @@ leveldb::Status IndexedDBBackingStore::DestroyBackingStore(
const base::FilePath& path_base,
const GURL& origin_url) {
const base::FilePath file_path =
- path_base.Append(ComputeFileName(origin_url));
+ path_base.Append(IndexedDBContextImpl::GetLevelDBFileName(origin_url));
DefaultLevelDBFactory leveldb_factory;
return leveldb_factory.DestroyLevelDB(file_path);
}
@@ -1013,10 +1002,10 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
return scoped_refptr<IndexedDBBackingStore>();
}
- const base::FilePath file_path =
- path_base.Append(ComputeFileName(origin_url));
- const base::FilePath blob_path =
- path_base.Append(ComputeBlobPath(origin_url));
+ const FilePath file_path =
+ path_base.Append(IndexedDBContextImpl::GetLevelDBFileName(origin_url));
+ const FilePath blob_path =
+ path_base.Append(IndexedDBContextImpl::GetBlobStoreFileName(origin_url));
if (IsPathTooLong(file_path)) {
*status = leveldb::Status::IOError("File path too long");

Powered by Google App Engine
This is Rietveld 408576698