OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/indexed_db/indexed_db_database.h" | 5 #include "content/browser/indexed_db/indexed_db_database.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 callbacks)); | 1672 callbacks)); |
1673 } | 1673 } |
1674 | 1674 |
1675 leveldb::Status IndexedDBDatabase::DeleteRangeOperation( | 1675 leveldb::Status IndexedDBDatabase::DeleteRangeOperation( |
1676 int64_t object_store_id, | 1676 int64_t object_store_id, |
1677 std::unique_ptr<IndexedDBKeyRange> key_range, | 1677 std::unique_ptr<IndexedDBKeyRange> key_range, |
1678 scoped_refptr<IndexedDBCallbacks> callbacks, | 1678 scoped_refptr<IndexedDBCallbacks> callbacks, |
1679 IndexedDBTransaction* transaction) { | 1679 IndexedDBTransaction* transaction) { |
1680 IDB_TRACE1("IndexedDBDatabase::DeleteRangeOperation", "txn.id", | 1680 IDB_TRACE1("IndexedDBDatabase::DeleteRangeOperation", "txn.id", |
1681 transaction->id()); | 1681 transaction->id()); |
| 1682 size_t delete_count = 0; |
1682 leveldb::Status s = | 1683 leveldb::Status s = |
1683 backing_store_->DeleteRange(transaction->BackingStoreTransaction(), id(), | 1684 backing_store_->DeleteRange(transaction->BackingStoreTransaction(), id(), |
1684 object_store_id, *key_range); | 1685 object_store_id, *key_range, &delete_count); |
1685 if (!s.ok()) | 1686 if (!s.ok()) |
1686 return s; | 1687 return s; |
1687 callbacks->OnSuccess(); | 1688 callbacks->OnSuccess(); |
1688 FilterObservation(transaction, object_store_id, blink::WebIDBDelete, | 1689 FilterObservation(transaction, object_store_id, blink::WebIDBDelete, |
1689 *key_range, nullptr); | 1690 *key_range, nullptr); |
1690 return s; | 1691 return s; |
1691 } | 1692 } |
1692 | 1693 |
1693 void IndexedDBDatabase::Clear(IndexedDBTransaction* transaction, | 1694 void IndexedDBDatabase::Clear(IndexedDBTransaction* transaction, |
1694 int64_t object_store_id, | 1695 int64_t object_store_id, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 if (status.IsCorruption()) { | 1949 if (status.IsCorruption()) { |
1949 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 1950 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, |
1950 message); | 1951 message); |
1951 factory_->HandleBackingStoreCorruption(backing_store_->origin(), error); | 1952 factory_->HandleBackingStoreCorruption(backing_store_->origin(), error); |
1952 } else { | 1953 } else { |
1953 factory_->HandleBackingStoreFailure(backing_store_->origin()); | 1954 factory_->HandleBackingStoreFailure(backing_store_->origin()); |
1954 } | 1955 } |
1955 } | 1956 } |
1956 | 1957 |
1957 } // namespace content | 1958 } // namespace content |
OLD | NEW |