Update V8 to version 3.29.50 (based on bleeding_edge revision r23756).
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_fake_backing_store.cc
blob49040ae947888a8786048d0e0021073597b2a1ee
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
3 // found in the LICENSE file.
5 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h"
7 #include "base/files/file_path.h"
8 #include "base/memory/scoped_ptr.h"
10 namespace content {
12 IndexedDBFakeBackingStore::IndexedDBFakeBackingStore()
13 : IndexedDBBackingStore(NULL /* indexed_db_factory */,
14 GURL("http://localhost:81"),
15 base::FilePath(),
16 NULL /* request_context */,
17 scoped_ptr<LevelDBDatabase>(),
18 scoped_ptr<LevelDBComparator>(),
19 NULL /* task_runner */) {
21 IndexedDBFakeBackingStore::IndexedDBFakeBackingStore(
22 IndexedDBFactory* factory,
23 base::SequencedTaskRunner* task_runner)
24 : IndexedDBBackingStore(factory,
25 GURL("http://localhost:81"),
26 base::FilePath(),
27 NULL /* request_context */,
28 scoped_ptr<LevelDBDatabase>(),
29 scoped_ptr<LevelDBComparator>(),
30 task_runner) {
32 IndexedDBFakeBackingStore::~IndexedDBFakeBackingStore() {}
34 std::vector<base::string16> IndexedDBFakeBackingStore::GetDatabaseNames(
35 leveldb::Status* s) {
36 *s = leveldb::Status::OK();
37 return std::vector<base::string16>();
39 leveldb::Status IndexedDBFakeBackingStore::GetIDBDatabaseMetaData(
40 const base::string16& name,
41 IndexedDBDatabaseMetadata*,
42 bool* found) {
43 return leveldb::Status::OK();
46 leveldb::Status IndexedDBFakeBackingStore::CreateIDBDatabaseMetaData(
47 const base::string16& name,
48 const base::string16& version,
49 int64 int_version,
50 int64* row_id) {
51 return leveldb::Status::OK();
53 bool IndexedDBFakeBackingStore::UpdateIDBDatabaseIntVersion(Transaction*,
54 int64 row_id,
55 int64 version) {
56 return false;
58 leveldb::Status IndexedDBFakeBackingStore::DeleteDatabase(
59 const base::string16& name) {
60 return leveldb::Status::OK();
63 leveldb::Status IndexedDBFakeBackingStore::CreateObjectStore(
64 Transaction*,
65 int64 database_id,
66 int64 object_store_id,
67 const base::string16& name,
68 const IndexedDBKeyPath&,
69 bool auto_increment) {
70 return leveldb::Status::OK();
73 leveldb::Status IndexedDBFakeBackingStore::DeleteObjectStore(
74 Transaction* transaction,
75 int64 database_id,
76 int64 object_store_id) {
77 return leveldb::Status::OK();
80 leveldb::Status IndexedDBFakeBackingStore::PutRecord(
81 IndexedDBBackingStore::Transaction* transaction,
82 int64 database_id,
83 int64 object_store_id,
84 const IndexedDBKey& key,
85 IndexedDBValue* value,
86 ScopedVector<storage::BlobDataHandle>* handles,
87 RecordIdentifier* record) {
88 return leveldb::Status::OK();
91 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore(
92 Transaction*,
93 int64 database_id,
94 int64 object_store_id) {
95 return leveldb::Status::OK();
97 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord(
98 Transaction*,
99 int64 database_id,
100 int64 object_store_id,
101 const RecordIdentifier&) {
102 return leveldb::Status::OK();
104 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber(
105 Transaction*,
106 int64 database_id,
107 int64 object_store_id,
108 int64* current_number) {
109 return leveldb::Status::OK();
111 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber(
112 Transaction*,
113 int64 database_id,
114 int64 object_store_id,
115 int64 new_number,
116 bool check_current) {
117 return leveldb::Status::OK();
119 leveldb::Status IndexedDBFakeBackingStore::KeyExistsInObjectStore(
120 Transaction*,
121 int64 database_id,
122 int64 object_store_id,
123 const IndexedDBKey&,
124 RecordIdentifier* found_record_identifier,
125 bool* found) {
126 return leveldb::Status::OK();
129 leveldb::Status IndexedDBFakeBackingStore::CreateIndex(
130 Transaction*,
131 int64 database_id,
132 int64 object_store_id,
133 int64 index_id,
134 const base::string16& name,
135 const IndexedDBKeyPath&,
136 bool is_unique,
137 bool is_multi_entry) {
138 return leveldb::Status::OK();
141 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*,
142 int64 database_id,
143 int64 object_store_id,
144 int64 index_id) {
145 return leveldb::Status::OK();
147 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord(
148 Transaction*,
149 int64 database_id,
150 int64 object_store_id,
151 int64 index_id,
152 const IndexedDBKey&,
153 const RecordIdentifier&) {
154 return leveldb::Status::OK();
157 void IndexedDBFakeBackingStore::ReportBlobUnused(int64 database_id,
158 int64 blob_key) {}
160 scoped_ptr<IndexedDBBackingStore::Cursor>
161 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor(
162 IndexedDBBackingStore::Transaction* transaction,
163 int64 database_id,
164 int64 object_store_id,
165 const IndexedDBKeyRange& key_range,
166 blink::WebIDBCursorDirection,
167 leveldb::Status* s) {
168 return scoped_ptr<IndexedDBBackingStore::Cursor>();
170 scoped_ptr<IndexedDBBackingStore::Cursor>
171 IndexedDBFakeBackingStore::OpenObjectStoreCursor(
172 IndexedDBBackingStore::Transaction* transaction,
173 int64 database_id,
174 int64 object_store_id,
175 const IndexedDBKeyRange& key_range,
176 blink::WebIDBCursorDirection,
177 leveldb::Status* s) {
178 return scoped_ptr<IndexedDBBackingStore::Cursor>();
180 scoped_ptr<IndexedDBBackingStore::Cursor>
181 IndexedDBFakeBackingStore::OpenIndexKeyCursor(
182 IndexedDBBackingStore::Transaction* transaction,
183 int64 database_id,
184 int64 object_store_id,
185 int64 index_id,
186 const IndexedDBKeyRange& key_range,
187 blink::WebIDBCursorDirection,
188 leveldb::Status* s) {
189 return scoped_ptr<IndexedDBBackingStore::Cursor>();
191 scoped_ptr<IndexedDBBackingStore::Cursor>
192 IndexedDBFakeBackingStore::OpenIndexCursor(
193 IndexedDBBackingStore::Transaction* transaction,
194 int64 database_id,
195 int64 object_store_id,
196 int64 index_id,
197 const IndexedDBKeyRange& key_range,
198 blink::WebIDBCursorDirection,
199 leveldb::Status* s) {
200 return scoped_ptr<IndexedDBBackingStore::Cursor>();
203 IndexedDBFakeBackingStore::FakeTransaction::FakeTransaction(
204 leveldb::Status result)
205 : IndexedDBBackingStore::Transaction(NULL), result_(result) {
207 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {}
208 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseOne(
209 scoped_refptr<BlobWriteCallback> callback) {
210 callback->Run(true);
211 return leveldb::Status::OK();
213 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseTwo() {
214 return result_;
216 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {}
218 } // namespace content