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

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

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More small build fixes. Created 6 years, 7 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_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index a7d5da06d2b04fdc8ba03223d15490f581a5717e..e2d4df2c7e38f896d2fac29aa3c42e6b8c369e65 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1206,42 +1206,22 @@ void IndexedDBDatabase::DeleteRangeOperation(
scoped_refptr<IndexedDBCallbacks> callbacks,
IndexedDBTransaction* transaction) {
IDB_TRACE("IndexedDBDatabase::DeleteRangeOperation");
- leveldb::Status s;
- scoped_ptr<IndexedDBBackingStore::Cursor> backing_store_cursor =
- backing_store_->OpenObjectStoreCursor(
- transaction->BackingStoreTransaction(),
- id(),
- object_store_id,
- *key_range,
- indexed_db::CURSOR_NEXT,
- &s);
- if (backing_store_cursor && s.ok()) {
- do {
- if (!backing_store_->DeleteRecord(
- transaction->BackingStoreTransaction(),
- id(),
- object_store_id,
- backing_store_cursor->record_identifier())
- .ok()) {
- callbacks->OnError(
- IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError,
- "Internal error deleting data in range"));
- return;
- }
- } while (backing_store_cursor->Continue(&s));
- }
-
+ leveldb::Status s =
+ backing_store_->DeleteRange(transaction->BackingStoreTransaction(),
+ id(),
+ object_store_id,
+ *key_range);
if (!s.ok()) {
+ base::string16 error_string =
+ ASCIIToUTF16("Internal error deleting data in range");
IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError,
- ASCIIToUTF16("Internal error deleting range"));
+ error_string);
transaction->Abort(error);
- if (s.IsCorruption()) {
+ if (s.IsCorruption())
jsbell 2014/05/28 21:29:15 Nit: needs {}
ericu 2014/05/28 22:50:42 Done.
factory_->HandleBackingStoreCorruption(backing_store_->origin_url(),
error);
- }
return;
}
-
callbacks->OnSuccess();
}

Powered by Google App Engine
This is Rietveld 408576698