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

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

Issue 17033004: Tell IDB frontend about data loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debug Created 7 years, 6 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_factory.cc
diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc
index 374e96c7d53f2cdb45b26c0448956b760029e8f1..75e5642f8cd4973d53a0c43214e99fd2ae5388c5 100644
--- a/content/browser/indexed_db/indexed_db_factory.cc
+++ b/content/browser/indexed_db/indexed_db_factory.cc
@@ -55,8 +55,9 @@ void IndexedDBFactory::GetDatabaseNames(
const string16& database_identifier,
const base::FilePath& data_directory) {
IDB_TRACE("IndexedDBFactory::get_database_names");
+ bool data_loss;
jsbell 2013/06/14 20:42:58 Add a TODO to figure out if this should be plumbed
dgrogan 2013/06/14 22:06:43 Done.
scoped_refptr<IndexedDBBackingStore> backing_store =
- OpenBackingStore(database_identifier, data_directory);
+ OpenBackingStore(database_identifier, data_directory, &data_loss);
if (!backing_store.get()) {
callbacks->OnError(
IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionUnknownError,
@@ -87,8 +88,9 @@ void IndexedDBFactory::DeleteDatabase(
}
// TODO(jsbell): Everything from now on should be done on another thread.
+ bool data_loss;
jsbell 2013/06/14 20:42:58 Also add a TODO here?
dgrogan 2013/06/14 22:06:43 Done.
scoped_refptr<IndexedDBBackingStore> backing_store =
- OpenBackingStore(database_identifier, data_directory);
+ OpenBackingStore(database_identifier, data_directory, &data_loss);
if (!backing_store.get()) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
@@ -114,7 +116,8 @@ void IndexedDBFactory::DeleteDatabase(
scoped_refptr<IndexedDBBackingStore> IndexedDBFactory::OpenBackingStore(
const string16& database_identifier,
- const base::FilePath& data_directory) {
+ const base::FilePath& data_directory,
+ bool* data_loss) {
const string16 file_identifier = ComputeFileIdentifier(database_identifier);
const bool open_in_memory = data_directory.empty();
@@ -128,7 +131,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBFactory::OpenBackingStore(
backing_store = IndexedDBBackingStore::OpenInMemory(file_identifier);
} else {
backing_store = IndexedDBBackingStore::Open(
- database_identifier, data_directory, file_identifier);
+ database_identifier, data_directory, file_identifier, data_loss);
}
if (backing_store.get()) {
@@ -163,9 +166,10 @@ void IndexedDBFactory::Open(
scoped_refptr<IndexedDBDatabase> database_backend;
IndexedDBDatabaseMap::iterator it =
database_backend_map_.find(unique_identifier);
+ bool data_loss = false;
if (it == database_backend_map_.end()) {
scoped_refptr<IndexedDBBackingStore> backing_store =
- OpenBackingStore(database_identifier, data_directory);
+ OpenBackingStore(database_identifier, data_directory, &data_loss);
if (!backing_store.get()) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
@@ -190,7 +194,7 @@ void IndexedDBFactory::Open(
}
database_backend->OpenConnection(
- callbacks, database_callbacks, transaction_id, version);
+ callbacks, database_callbacks, transaction_id, version, data_loss);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698