| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 int64 object_store_id, | 92 int64 object_store_id, |
| 93 int64 index_id) OVERRIDE; | 93 int64 index_id) OVERRIDE; |
| 94 virtual leveldb::Status PutIndexDataForRecord(Transaction*, | 94 virtual leveldb::Status PutIndexDataForRecord(Transaction*, |
| 95 int64 database_id, | 95 int64 database_id, |
| 96 int64 object_store_id, | 96 int64 object_store_id, |
| 97 int64 index_id, | 97 int64 index_id, |
| 98 const IndexedDBKey&, | 98 const IndexedDBKey&, |
| 99 const RecordIdentifier&) | 99 const RecordIdentifier&) |
| 100 OVERRIDE; | 100 OVERRIDE; |
| 101 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) OVERRIDE; | 101 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) OVERRIDE; |
| 102 | |
| 103 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( | 102 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( |
| 104 Transaction* transaction, | 103 Transaction* transaction, |
| 105 int64 database_id, | 104 int64 database_id, |
| 106 int64 object_store_id, | 105 int64 object_store_id, |
| 107 const IndexedDBKeyRange& key_range, | 106 const IndexedDBKeyRange& key_range, |
| 108 indexed_db::CursorDirection, | 107 indexed_db::CursorDirection, |
| 109 leveldb::Status*) OVERRIDE; | 108 leveldb::Status*) OVERRIDE; |
| 110 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( | 109 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( |
| 111 Transaction* transaction, | 110 Transaction* transaction, |
| 112 int64 database_id, | 111 int64 database_id, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 125 virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, | 124 virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, |
| 126 int64 database_id, | 125 int64 database_id, |
| 127 int64 object_store_id, | 126 int64 object_store_id, |
| 128 int64 index_id, | 127 int64 index_id, |
| 129 const IndexedDBKeyRange& key_range, | 128 const IndexedDBKeyRange& key_range, |
| 130 indexed_db::CursorDirection, | 129 indexed_db::CursorDirection, |
| 131 leveldb::Status*) OVERRIDE; | 130 leveldb::Status*) OVERRIDE; |
| 132 | 131 |
| 133 class FakeTransaction : public IndexedDBBackingStore::Transaction { | 132 class FakeTransaction : public IndexedDBBackingStore::Transaction { |
| 134 public: | 133 public: |
| 135 FakeTransaction(bool result); | 134 FakeTransaction(leveldb::Status phase_two_result); |
| 136 virtual void Begin() OVERRIDE; | 135 virtual void Begin() OVERRIDE; |
| 137 virtual leveldb::Status Commit() OVERRIDE; | 136 virtual leveldb::Status CommitPhaseOne( |
| 137 scoped_refptr<BlobWriteCallback>) OVERRIDE; |
| 138 virtual leveldb::Status CommitPhaseTwo() OVERRIDE; |
| 138 virtual void Rollback() OVERRIDE; | 139 virtual void Rollback() OVERRIDE; |
| 139 | 140 |
| 140 private: | 141 private: |
| 141 bool result_; | 142 leveldb::Status result_; |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 protected: | 145 protected: |
| 145 friend class base::RefCounted<IndexedDBFakeBackingStore>; | 146 friend class base::RefCounted<IndexedDBFakeBackingStore>; |
| 146 virtual ~IndexedDBFakeBackingStore(); | 147 virtual ~IndexedDBFakeBackingStore(); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 } // namespace content | 150 } // namespace content |
| 150 | 151 |
| 151 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 152 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| OLD | NEW |