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

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: DeleteRange now seems to work. 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 1d9ccbbc5f273bfda9efabeb901453c50a71a0da..4e62a08e2c7cfcc023a5a2b3c2f50074b6de0aff 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -6,6 +6,7 @@
#include <math.h>
#include <set>
+#include <vector>
#include "base/auto_reset.h"
#include "base/logging.h"
@@ -1223,42 +1224,15 @@ 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));
- }
-
- if (!s.ok()) {
- IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError,
- ASCIIToUTF16("Internal error deleting range"));
- transaction->Abort(error);
- if (s.IsCorruption()) {
- factory_->HandleBackingStoreCorruption(backing_store_->origin_url(),
- error);
- }
+ if (!backing_store_->DeleteRange(transaction->BackingStoreTransaction(),
+ id(),
+ object_store_id,
+ *key_range).ok()) {
+ callbacks->OnError(
+ IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError,
+ "Internal error deleting data in range"));
return;
}
-
callbacks->OnSuccess();
}

Powered by Google App Engine
This is Rietveld 408576698