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

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: ToT 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
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.h ('k') | content/child/indexed_db/indexed_db_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ba1e7e711751d62c9dda57c5becba50a00c78066..730c2e741412989117c19d9e0a1dd0502b2b92c3 100644
--- a/content/browser/indexed_db/indexed_db_factory.cc
+++ b/content/browser/indexed_db/indexed_db_factory.cc
@@ -55,8 +55,10 @@ void IndexedDBFactory::GetDatabaseNames(
const string16& database_identifier,
const base::FilePath& data_directory) {
IDB_TRACE("IndexedDBFactory::GetDatabaseNames");
+ // TODO(dgrogan): Plumb data_loss back to script eventually?
+ WebKit::WebIDBCallbacks::DataLoss data_loss;
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,
@@ -86,8 +88,11 @@ void IndexedDBFactory::DeleteDatabase(
return;
}
+
+ // TODO(dgrogan): Plumb data_loss back to script eventually?
+ WebKit::WebIDBCallbacks::DataLoss data_loss;
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,
@@ -113,7 +118,8 @@ void IndexedDBFactory::DeleteDatabase(
scoped_refptr<IndexedDBBackingStore> IndexedDBFactory::OpenBackingStore(
const string16& database_identifier,
- const base::FilePath& data_directory) {
+ const base::FilePath& data_directory,
+ WebKit::WebIDBCallbacks::DataLoss* data_loss) {
const string16 file_identifier = ComputeFileIdentifier(database_identifier);
const bool open_in_memory = data_directory.empty();
@@ -127,7 +133,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()) {
@@ -162,9 +168,11 @@ void IndexedDBFactory::Open(
scoped_refptr<IndexedDBDatabase> database_backend;
IndexedDBDatabaseMap::iterator it =
database_backend_map_.find(unique_identifier);
+ WebKit::WebIDBCallbacks::DataLoss data_loss =
+ WebKit::WebIDBCallbacks::DataLossNone;
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,
@@ -189,7 +197,7 @@ void IndexedDBFactory::Open(
}
database_backend->OpenConnection(
- callbacks, database_callbacks, transaction_id, version);
+ callbacks, database_callbacks, transaction_id, version, data_loss);
}
} // namespace content
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.h ('k') | content/child/indexed_db/indexed_db_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698