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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 database_id, |
66 int64 object_store_id, | 66 int64 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::IOError("test error"); | 70 return leveldb::Status::OK(); |
| 71 } |
| 72 |
| 73 leveldb::Status IndexedDBFakeBackingStore::PutRecord( |
| 74 IndexedDBBackingStore::Transaction* transaction, |
| 75 int64 database_id, |
| 76 int64 object_store_id, |
| 77 const IndexedDBKey& key, |
| 78 IndexedDBValue& value, |
| 79 ScopedVector<webkit_blob::BlobDataHandle>* handles, |
| 80 RecordIdentifier* record) { |
| 81 return leveldb::Status::OK(); |
71 } | 82 } |
72 | 83 |
73 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( | 84 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( |
74 Transaction*, | 85 Transaction*, |
75 int64 database_id, | 86 int64 database_id, |
76 int64 object_store_id) { | 87 int64 object_store_id) { |
77 return leveldb::Status::IOError("test error"); | 88 return leveldb::Status::OK(); |
78 } | 89 } |
79 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( | 90 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( |
80 Transaction*, | 91 Transaction*, |
81 int64 database_id, | 92 int64 database_id, |
82 int64 object_store_id, | 93 int64 object_store_id, |
83 const RecordIdentifier&) { | 94 const RecordIdentifier&) { |
84 return leveldb::Status::IOError("test error"); | 95 return leveldb::Status::OK(); |
85 } | 96 } |
86 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( | 97 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( |
87 Transaction*, | 98 Transaction*, |
88 int64 database_id, | 99 int64 database_id, |
89 int64 object_store_id, | 100 int64 object_store_id, |
90 int64* current_number) { | 101 int64* current_number) { |
91 return leveldb::Status::OK(); | 102 return leveldb::Status::OK(); |
92 } | 103 } |
93 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( | 104 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( |
94 Transaction*, | 105 Transaction*, |
(...skipping 15 matching lines...) Expand all Loading... |
110 | 121 |
111 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( | 122 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( |
112 Transaction*, | 123 Transaction*, |
113 int64 database_id, | 124 int64 database_id, |
114 int64 object_store_id, | 125 int64 object_store_id, |
115 int64 index_id, | 126 int64 index_id, |
116 const base::string16& name, | 127 const base::string16& name, |
117 const IndexedDBKeyPath&, | 128 const IndexedDBKeyPath&, |
118 bool is_unique, | 129 bool is_unique, |
119 bool is_multi_entry) { | 130 bool is_multi_entry) { |
120 return leveldb::Status::IOError("test error"); | 131 return leveldb::Status::OK(); |
121 } | 132 } |
122 | 133 |
123 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, | 134 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, |
124 int64 database_id, | 135 int64 database_id, |
125 int64 object_store_id, | 136 int64 object_store_id, |
126 int64 index_id) { | 137 int64 index_id) { |
127 return leveldb::Status::IOError("test error"); | 138 return leveldb::Status::OK(); |
128 } | 139 } |
129 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( | 140 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( |
130 Transaction*, | 141 Transaction*, |
131 int64 database_id, | 142 int64 database_id, |
132 int64 object_store_id, | 143 int64 object_store_id, |
133 int64 index_id, | 144 int64 index_id, |
134 const IndexedDBKey&, | 145 const IndexedDBKey&, |
135 const RecordIdentifier&) { | 146 const RecordIdentifier&) { |
136 return leveldb::Status::IOError("test error"); | 147 return leveldb::Status::OK(); |
137 } | 148 } |
138 | 149 |
139 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id, | 150 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id, |
140 int64 blob_key) {} | 151 int64 blob_key) {} |
141 | 152 |
142 scoped_ptr<IndexedDBBackingStore::Cursor> | 153 scoped_ptr<IndexedDBBackingStore::Cursor> |
143 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( | 154 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( |
144 IndexedDBBackingStore::Transaction* transaction, | 155 IndexedDBBackingStore::Transaction* transaction, |
145 int64 database_id, | 156 int64 database_id, |
146 int64 object_store_id, | 157 int64 object_store_id, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} | 198 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} |
188 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::Commit() { | 199 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::Commit() { |
189 if (result_) | 200 if (result_) |
190 return leveldb::Status::OK(); | 201 return leveldb::Status::OK(); |
191 else | 202 else |
192 return leveldb::Status::IOError("test error"); | 203 return leveldb::Status::IOError("test error"); |
193 } | 204 } |
194 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} | 205 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} |
195 | 206 |
196 } // namespace content | 207 } // namespace content |
OLD | NEW |