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

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

Issue 2140193002: IndexedDB: Saving data loss status in IndexedDBPendingConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@idb-data-loss
Patch Set: Deleted commented out code. Created 4 years, 5 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_impl.cc
diff --git a/content/browser/indexed_db/indexed_db_factory_impl.cc b/content/browser/indexed_db/indexed_db_factory_impl.cc
index 1ddb6d4d1d5dca61ff5fb0e4fd416bf0ae84eebb..de072a298bb11926f714b954cfcb5eb4d679cd05 100644
--- a/content/browser/indexed_db/indexed_db_factory_impl.cc
+++ b/content/browser/indexed_db/indexed_db_factory_impl.cc
@@ -397,11 +397,12 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBFactoryImpl::OpenBackingStore(
return 0;
}
-void IndexedDBFactoryImpl::Open(const base::string16& name,
- const IndexedDBPendingConnection& connection,
- net::URLRequestContext* request_context,
- const Origin& origin,
- const base::FilePath& data_directory) {
+void IndexedDBFactoryImpl::Open(
+ const base::string16& name,
+ std::unique_ptr<IndexedDBPendingConnection> connection,
+ net::URLRequestContext* request_context,
+ const Origin& origin,
+ const base::FilePath& data_directory) {
IDB_TRACE("IndexedDBFactoryImpl::Open");
scoped_refptr<IndexedDBDatabase> database;
IndexedDBDatabase::Identifier unique_identifier(origin, name);
@@ -416,18 +417,17 @@ void IndexedDBFactoryImpl::Open(const base::string16& name,
&data_loss_info, &disk_full, &s);
if (!backing_store.get()) {
if (disk_full) {
- connection.callbacks->OnError(
- IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionQuotaError,
- ASCIIToUTF16(
- "Encountered full disk while opening "
- "backing store for indexedDB.open.")));
+ connection->callbacks->OnError(IndexedDBDatabaseError(
+ blink::WebIDBDatabaseExceptionQuotaError,
+ ASCIIToUTF16("Encountered full disk while opening "
+ "backing store for indexedDB.open.")));
return;
}
IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError,
ASCIIToUTF16(
"Internal error opening backing store"
" for indexedDB.open."));
- connection.callbacks->OnError(error);
+ connection->callbacks->OnError(error);
if (s.IsCorruption()) {
HandleBackingStoreCorruption(origin, error);
}
@@ -443,7 +443,7 @@ void IndexedDBFactoryImpl::Open(const base::string16& name,
"Internal error creating "
"database backend for "
"indexedDB.open."));
- connection.callbacks->OnError(error);
+ connection->callbacks->OnError(error);
if (s.IsCorruption()) {
backing_store = NULL; // Closes the LevelDB so that it can be deleted
HandleBackingStoreCorruption(origin, error);
@@ -454,10 +454,9 @@ void IndexedDBFactoryImpl::Open(const base::string16& name,
database = it->second;
}
- if (data_loss_info.status != blink::WebIDBDataLossNone)
- connection.callbacks->OnDataLoss(data_loss_info);
+ connection->data_loss_info = data_loss_info;
- database->OpenConnection(connection);
+ database->OpenConnection(std::move(connection));
if (!was_open && database->ConnectionCount() > 0) {
database_map_[unique_identifier] = database.get();
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory_impl.h ('k') | content/browser/indexed_db/indexed_db_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698