| 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 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 leveldb::Status IndexedDBFakeBackingStore::GetIDBDatabaseMetaData( | 39 leveldb::Status IndexedDBFakeBackingStore::GetIDBDatabaseMetaData( |
| 40 const base::string16& name, | 40 const base::string16& name, |
| 41 IndexedDBDatabaseMetadata*, | 41 IndexedDBDatabaseMetadata*, |
| 42 bool* found) { | 42 bool* found) { |
| 43 return leveldb::Status::OK(); | 43 return leveldb::Status::OK(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 leveldb::Status IndexedDBFakeBackingStore::CreateIDBDatabaseMetaData( | 46 leveldb::Status IndexedDBFakeBackingStore::CreateIDBDatabaseMetaData( |
| 47 const base::string16& name, | 47 const base::string16& name, |
| 48 const base::string16& version, | 48 const base::string16& version, |
| 49 int64 int_version, | 49 int64_t int_version, |
| 50 int64* row_id) { | 50 int64_t* row_id) { |
| 51 return leveldb::Status::OK(); | 51 return leveldb::Status::OK(); |
| 52 } | 52 } |
| 53 bool IndexedDBFakeBackingStore::UpdateIDBDatabaseIntVersion(Transaction*, | 53 bool IndexedDBFakeBackingStore::UpdateIDBDatabaseIntVersion(Transaction*, |
| 54 int64 row_id, | 54 int64_t row_id, |
| 55 int64 version) { | 55 int64_t version) { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 leveldb::Status IndexedDBFakeBackingStore::DeleteDatabase( | 58 leveldb::Status IndexedDBFakeBackingStore::DeleteDatabase( |
| 59 const base::string16& name) { | 59 const base::string16& name) { |
| 60 return leveldb::Status::OK(); | 60 return leveldb::Status::OK(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 leveldb::Status IndexedDBFakeBackingStore::CreateObjectStore( | 63 leveldb::Status IndexedDBFakeBackingStore::CreateObjectStore( |
| 64 Transaction*, | 64 Transaction*, |
| 65 int64 database_id, | 65 int64_t database_id, |
| 66 int64 object_store_id, | 66 int64_t object_store_id, |
| 67 const base::string16& name, | 67 const base::string16& name, |
| 68 const IndexedDBKeyPath&, | 68 const IndexedDBKeyPath&, |
| 69 bool auto_increment) { | 69 bool auto_increment) { |
| 70 return leveldb::Status::OK(); | 70 return leveldb::Status::OK(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 leveldb::Status IndexedDBFakeBackingStore::DeleteObjectStore( | 73 leveldb::Status IndexedDBFakeBackingStore::DeleteObjectStore( |
| 74 Transaction* transaction, | 74 Transaction* transaction, |
| 75 int64 database_id, | 75 int64_t database_id, |
| 76 int64 object_store_id) { | 76 int64_t object_store_id) { |
| 77 return leveldb::Status::OK(); | 77 return leveldb::Status::OK(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 leveldb::Status IndexedDBFakeBackingStore::PutRecord( | 80 leveldb::Status IndexedDBFakeBackingStore::PutRecord( |
| 81 IndexedDBBackingStore::Transaction* transaction, | 81 IndexedDBBackingStore::Transaction* transaction, |
| 82 int64 database_id, | 82 int64_t database_id, |
| 83 int64 object_store_id, | 83 int64_t object_store_id, |
| 84 const IndexedDBKey& key, | 84 const IndexedDBKey& key, |
| 85 IndexedDBValue* value, | 85 IndexedDBValue* value, |
| 86 ScopedVector<storage::BlobDataHandle>* handles, | 86 ScopedVector<storage::BlobDataHandle>* handles, |
| 87 RecordIdentifier* record) { | 87 RecordIdentifier* record) { |
| 88 return leveldb::Status::OK(); | 88 return leveldb::Status::OK(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( | 91 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( |
| 92 Transaction*, | 92 Transaction*, |
| 93 int64 database_id, | 93 int64_t database_id, |
| 94 int64 object_store_id) { | 94 int64_t object_store_id) { |
| 95 return leveldb::Status::OK(); | 95 return leveldb::Status::OK(); |
| 96 } | 96 } |
| 97 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( | 97 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( |
| 98 Transaction*, | 98 Transaction*, |
| 99 int64 database_id, | 99 int64_t database_id, |
| 100 int64 object_store_id, | 100 int64_t object_store_id, |
| 101 const RecordIdentifier&) { | 101 const RecordIdentifier&) { |
| 102 return leveldb::Status::OK(); | 102 return leveldb::Status::OK(); |
| 103 } | 103 } |
| 104 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( | 104 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( |
| 105 Transaction*, | 105 Transaction*, |
| 106 int64 database_id, | 106 int64_t database_id, |
| 107 int64 object_store_id, | 107 int64_t object_store_id, |
| 108 int64* current_number) { | 108 int64_t* current_number) { |
| 109 return leveldb::Status::OK(); | 109 return leveldb::Status::OK(); |
| 110 } | 110 } |
| 111 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( | 111 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( |
| 112 Transaction*, | 112 Transaction*, |
| 113 int64 database_id, | 113 int64_t database_id, |
| 114 int64 object_store_id, | 114 int64_t object_store_id, |
| 115 int64 new_number, | 115 int64_t new_number, |
| 116 bool check_current) { | 116 bool check_current) { |
| 117 return leveldb::Status::OK(); | 117 return leveldb::Status::OK(); |
| 118 } | 118 } |
| 119 leveldb::Status IndexedDBFakeBackingStore::KeyExistsInObjectStore( | 119 leveldb::Status IndexedDBFakeBackingStore::KeyExistsInObjectStore( |
| 120 Transaction*, | 120 Transaction*, |
| 121 int64 database_id, | 121 int64_t database_id, |
| 122 int64 object_store_id, | 122 int64_t object_store_id, |
| 123 const IndexedDBKey&, | 123 const IndexedDBKey&, |
| 124 RecordIdentifier* found_record_identifier, | 124 RecordIdentifier* found_record_identifier, |
| 125 bool* found) { | 125 bool* found) { |
| 126 return leveldb::Status::OK(); | 126 return leveldb::Status::OK(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( | 129 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( |
| 130 Transaction*, | 130 Transaction*, |
| 131 int64 database_id, | 131 int64_t database_id, |
| 132 int64 object_store_id, | 132 int64_t object_store_id, |
| 133 int64 index_id, | 133 int64_t index_id, |
| 134 const base::string16& name, | 134 const base::string16& name, |
| 135 const IndexedDBKeyPath&, | 135 const IndexedDBKeyPath&, |
| 136 bool is_unique, | 136 bool is_unique, |
| 137 bool is_multi_entry) { | 137 bool is_multi_entry) { |
| 138 return leveldb::Status::OK(); | 138 return leveldb::Status::OK(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, | 141 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, |
| 142 int64 database_id, | 142 int64_t database_id, |
| 143 int64 object_store_id, | 143 int64_t object_store_id, |
| 144 int64 index_id) { | 144 int64_t index_id) { |
| 145 return leveldb::Status::OK(); | 145 return leveldb::Status::OK(); |
| 146 } | 146 } |
| 147 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( | 147 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( |
| 148 Transaction*, | 148 Transaction*, |
| 149 int64 database_id, | 149 int64_t database_id, |
| 150 int64 object_store_id, | 150 int64_t object_store_id, |
| 151 int64 index_id, | 151 int64_t index_id, |
| 152 const IndexedDBKey&, | 152 const IndexedDBKey&, |
| 153 const RecordIdentifier&) { | 153 const RecordIdentifier&) { |
| 154 return leveldb::Status::OK(); | 154 return leveldb::Status::OK(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id, | 157 void IndexedDBFakeBackingStore::ReportBlobUnused(int64_t database_id, |
| 158 int64 blob_key) {} | 158 int64_t blob_key) {} |
| 159 | 159 |
| 160 scoped_ptr<IndexedDBBackingStore::Cursor> | 160 scoped_ptr<IndexedDBBackingStore::Cursor> |
| 161 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( | 161 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( |
| 162 IndexedDBBackingStore::Transaction* transaction, | 162 IndexedDBBackingStore::Transaction* transaction, |
| 163 int64 database_id, | 163 int64_t database_id, |
| 164 int64 object_store_id, | 164 int64_t object_store_id, |
| 165 const IndexedDBKeyRange& key_range, | 165 const IndexedDBKeyRange& key_range, |
| 166 blink::WebIDBCursorDirection, | 166 blink::WebIDBCursorDirection, |
| 167 leveldb::Status* s) { | 167 leveldb::Status* s) { |
| 168 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 168 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
| 169 } | 169 } |
| 170 scoped_ptr<IndexedDBBackingStore::Cursor> | 170 scoped_ptr<IndexedDBBackingStore::Cursor> |
| 171 IndexedDBFakeBackingStore::OpenObjectStoreCursor( | 171 IndexedDBFakeBackingStore::OpenObjectStoreCursor( |
| 172 IndexedDBBackingStore::Transaction* transaction, | 172 IndexedDBBackingStore::Transaction* transaction, |
| 173 int64 database_id, | 173 int64_t database_id, |
| 174 int64 object_store_id, | 174 int64_t object_store_id, |
| 175 const IndexedDBKeyRange& key_range, | 175 const IndexedDBKeyRange& key_range, |
| 176 blink::WebIDBCursorDirection, | 176 blink::WebIDBCursorDirection, |
| 177 leveldb::Status* s) { | 177 leveldb::Status* s) { |
| 178 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 178 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
| 179 } | 179 } |
| 180 scoped_ptr<IndexedDBBackingStore::Cursor> | 180 scoped_ptr<IndexedDBBackingStore::Cursor> |
| 181 IndexedDBFakeBackingStore::OpenIndexKeyCursor( | 181 IndexedDBFakeBackingStore::OpenIndexKeyCursor( |
| 182 IndexedDBBackingStore::Transaction* transaction, | 182 IndexedDBBackingStore::Transaction* transaction, |
| 183 int64 database_id, | 183 int64_t database_id, |
| 184 int64 object_store_id, | 184 int64_t object_store_id, |
| 185 int64 index_id, | 185 int64_t index_id, |
| 186 const IndexedDBKeyRange& key_range, | 186 const IndexedDBKeyRange& key_range, |
| 187 blink::WebIDBCursorDirection, | 187 blink::WebIDBCursorDirection, |
| 188 leveldb::Status* s) { | 188 leveldb::Status* s) { |
| 189 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 189 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
| 190 } | 190 } |
| 191 scoped_ptr<IndexedDBBackingStore::Cursor> | 191 scoped_ptr<IndexedDBBackingStore::Cursor> |
| 192 IndexedDBFakeBackingStore::OpenIndexCursor( | 192 IndexedDBFakeBackingStore::OpenIndexCursor( |
| 193 IndexedDBBackingStore::Transaction* transaction, | 193 IndexedDBBackingStore::Transaction* transaction, |
| 194 int64 database_id, | 194 int64_t database_id, |
| 195 int64 object_store_id, | 195 int64_t object_store_id, |
| 196 int64 index_id, | 196 int64_t index_id, |
| 197 const IndexedDBKeyRange& key_range, | 197 const IndexedDBKeyRange& key_range, |
| 198 blink::WebIDBCursorDirection, | 198 blink::WebIDBCursorDirection, |
| 199 leveldb::Status* s) { | 199 leveldb::Status* s) { |
| 200 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 200 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 IndexedDBFakeBackingStore::FakeTransaction::FakeTransaction( | 203 IndexedDBFakeBackingStore::FakeTransaction::FakeTransaction( |
| 204 leveldb::Status result) | 204 leveldb::Status result) |
| 205 : IndexedDBBackingStore::Transaction(NULL), result_(result) { | 205 : IndexedDBBackingStore::Transaction(NULL), result_(result) { |
| 206 } | 206 } |
| 207 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} | 207 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} |
| 208 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseOne( | 208 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseOne( |
| 209 scoped_refptr<BlobWriteCallback> callback) { | 209 scoped_refptr<BlobWriteCallback> callback) { |
| 210 callback->Run(true); | 210 callback->Run(true); |
| 211 return leveldb::Status::OK(); | 211 return leveldb::Status::OK(); |
| 212 } | 212 } |
| 213 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseTwo() { | 213 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseTwo() { |
| 214 return result_; | 214 return result_; |
| 215 } | 215 } |
| 216 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} | 216 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} |
| 217 | 217 |
| 218 } // namespace content | 218 } // namespace content |
| OLD | NEW |