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; | |
1683 leveldb::Status s = | 1682 leveldb::Status s = |
1684 backing_store_->DeleteRange(transaction->BackingStoreTransaction(), id(), | 1683 backing_store_->DeleteRange(transaction->BackingStoreTransaction(), id(), |
1685 object_store_id, *key_range, &delete_count); | 1684 object_store_id, *key_range); |
1686 if (!s.ok()) | 1685 if (!s.ok()) |
1687 return s; | 1686 return s; |
1688 callbacks->OnSuccess(); | 1687 callbacks->OnSuccess(); |
1689 FilterObservation(transaction, object_store_id, blink::WebIDBDelete, | 1688 FilterObservation(transaction, object_store_id, blink::WebIDBDelete, |
1690 *key_range, nullptr); | 1689 *key_range, nullptr); |
1691 return s; | 1690 return s; |
1692 } | 1691 } |
1693 | 1692 |
1694 void IndexedDBDatabase::Clear(IndexedDBTransaction* transaction, | 1693 void IndexedDBDatabase::Clear(IndexedDBTransaction* transaction, |
1695 int64_t object_store_id, | 1694 int64_t object_store_id, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 if (status.IsCorruption()) { | 1948 if (status.IsCorruption()) { |
1950 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 1949 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, |
1951 message); | 1950 message); |
1952 factory_->HandleBackingStoreCorruption(backing_store_->origin(), error); | 1951 factory_->HandleBackingStoreCorruption(backing_store_->origin(), error); |
1953 } else { | 1952 } else { |
1954 factory_->HandleBackingStoreFailure(backing_store_->origin()); | 1953 factory_->HandleBackingStoreFailure(backing_store_->origin()); |
1955 } | 1954 } |
1956 } | 1955 } |
1957 | 1956 |
1958 } // namespace content | 1957 } // namespace content |
OLD | NEW |