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 } | 71 } |
72 | 72 |
73 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( | 73 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore( |
74 Transaction*, | 74 Transaction*, |
75 int64 database_id, | 75 int64 database_id, |
76 int64 object_store_id) { | 76 int64 object_store_id) { |
77 return leveldb::Status::IOError("test error"); | 77 return leveldb::Status::OK(); |
78 } | 78 } |
79 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( | 79 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord( |
80 Transaction*, | 80 Transaction*, |
81 int64 database_id, | 81 int64 database_id, |
82 int64 object_store_id, | 82 int64 object_store_id, |
83 const RecordIdentifier&) { | 83 const RecordIdentifier&) { |
84 return leveldb::Status::IOError("test error"); | 84 return leveldb::Status::OK(); |
85 } | 85 } |
86 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( | 86 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber( |
87 Transaction*, | 87 Transaction*, |
88 int64 database_id, | 88 int64 database_id, |
89 int64 object_store_id, | 89 int64 object_store_id, |
90 int64* current_number) { | 90 int64* current_number) { |
91 return leveldb::Status::OK(); | 91 return leveldb::Status::OK(); |
92 } | 92 } |
93 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( | 93 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber( |
94 Transaction*, | 94 Transaction*, |
(...skipping 15 matching lines...) Expand all Loading... |
110 | 110 |
111 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( | 111 leveldb::Status IndexedDBFakeBackingStore::CreateIndex( |
112 Transaction*, | 112 Transaction*, |
113 int64 database_id, | 113 int64 database_id, |
114 int64 object_store_id, | 114 int64 object_store_id, |
115 int64 index_id, | 115 int64 index_id, |
116 const base::string16& name, | 116 const base::string16& name, |
117 const IndexedDBKeyPath&, | 117 const IndexedDBKeyPath&, |
118 bool is_unique, | 118 bool is_unique, |
119 bool is_multi_entry) { | 119 bool is_multi_entry) { |
120 return leveldb::Status::IOError("test error"); | 120 return leveldb::Status::OK(); |
121 } | 121 } |
122 | 122 |
123 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, | 123 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*, |
124 int64 database_id, | 124 int64 database_id, |
125 int64 object_store_id, | 125 int64 object_store_id, |
126 int64 index_id) { | 126 int64 index_id) { |
127 return leveldb::Status::IOError("test error"); | 127 return leveldb::Status::OK(); |
128 } | 128 } |
129 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( | 129 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord( |
130 Transaction*, | 130 Transaction*, |
131 int64 database_id, | 131 int64 database_id, |
132 int64 object_store_id, | 132 int64 object_store_id, |
133 int64 index_id, | 133 int64 index_id, |
134 const IndexedDBKey&, | 134 const IndexedDBKey&, |
135 const RecordIdentifier&) { | 135 const RecordIdentifier&) { |
136 return leveldb::Status::IOError("test error"); | 136 return leveldb::Status::OK(); |
137 } | 137 } |
138 | 138 |
139 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id, | 139 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id, |
140 int64 blob_key) {} | 140 int64 blob_key) {} |
141 | 141 |
142 scoped_ptr<IndexedDBBackingStore::Cursor> | 142 scoped_ptr<IndexedDBBackingStore::Cursor> |
143 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( | 143 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor( |
144 IndexedDBBackingStore::Transaction* transaction, | 144 IndexedDBBackingStore::Transaction* transaction, |
145 int64 database_id, | 145 int64 database_id, |
146 int64 object_store_id, | 146 int64 object_store_id, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} | 187 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} |
188 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::Commit() { | 188 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::Commit() { |
189 if (result_) | 189 if (result_) |
190 return leveldb::Status::OK(); | 190 return leveldb::Status::OK(); |
191 else | 191 else |
192 return leveldb::Status::IOError("test error"); | 192 return leveldb::Status::IOError("test error"); |
193 } | 193 } |
194 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} | 194 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {} |
195 | 195 |
196 } // namespace content | 196 } // namespace content |
OLD | NEW |