Cast: Skip receiver log messages with time delta that can't be encoded.
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_fake_backing_store.cc
blob18ca50cbab595363fa726a044dda433b94378886
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/memory/scoped_ptr.h"
9 namespace content {
11 IndexedDBFakeBackingStore::~IndexedDBFakeBackingStore() {}
13 std::vector<base::string16> IndexedDBFakeBackingStore::GetDatabaseNames() {
14 return std::vector<base::string16>();
16 leveldb::Status IndexedDBFakeBackingStore::GetIDBDatabaseMetaData(
17 const base::string16& name,
18 IndexedDBDatabaseMetadata*,
19 bool* found) {
20 return leveldb::Status::OK();
23 leveldb::Status IndexedDBFakeBackingStore::CreateIDBDatabaseMetaData(
24 const base::string16& name,
25 const base::string16& version,
26 int64 int_version,
27 int64* row_id) {
28 return leveldb::Status::OK();
30 bool IndexedDBFakeBackingStore::UpdateIDBDatabaseIntVersion(Transaction*,
31 int64 row_id,
32 int64 version) {
33 return false;
35 leveldb::Status IndexedDBFakeBackingStore::DeleteDatabase(
36 const base::string16& name) {
37 return leveldb::Status::OK();
40 leveldb::Status IndexedDBFakeBackingStore::CreateObjectStore(
41 Transaction*,
42 int64 database_id,
43 int64 object_store_id,
44 const base::string16& name,
45 const IndexedDBKeyPath&,
46 bool auto_increment) {
47 return leveldb::Status::IOError("test error");
50 leveldb::Status IndexedDBFakeBackingStore::ClearObjectStore(
51 Transaction*,
52 int64 database_id,
53 int64 object_store_id) {
54 return leveldb::Status::IOError("test error");
56 leveldb::Status IndexedDBFakeBackingStore::DeleteRecord(
57 Transaction*,
58 int64 database_id,
59 int64 object_store_id,
60 const RecordIdentifier&) {
61 return leveldb::Status::IOError("test error");
63 leveldb::Status IndexedDBFakeBackingStore::GetKeyGeneratorCurrentNumber(
64 Transaction*,
65 int64 database_id,
66 int64 object_store_id,
67 int64* current_number) {
68 return leveldb::Status::OK();
70 leveldb::Status IndexedDBFakeBackingStore::MaybeUpdateKeyGeneratorCurrentNumber(
71 Transaction*,
72 int64 database_id,
73 int64 object_store_id,
74 int64 new_number,
75 bool check_current) {
76 return leveldb::Status::OK();
78 leveldb::Status IndexedDBFakeBackingStore::KeyExistsInObjectStore(
79 Transaction*,
80 int64 database_id,
81 int64 object_store_id,
82 const IndexedDBKey&,
83 RecordIdentifier* found_record_identifier,
84 bool* found) {
85 return leveldb::Status::OK();
88 leveldb::Status IndexedDBFakeBackingStore::CreateIndex(
89 Transaction*,
90 int64 database_id,
91 int64 object_store_id,
92 int64 index_id,
93 const base::string16& name,
94 const IndexedDBKeyPath&,
95 bool is_unique,
96 bool is_multi_entry) {
97 return leveldb::Status::IOError("test error");
100 leveldb::Status IndexedDBFakeBackingStore::DeleteIndex(Transaction*,
101 int64 database_id,
102 int64 object_store_id,
103 int64 index_id) {
104 return leveldb::Status::IOError("test error");
106 leveldb::Status IndexedDBFakeBackingStore::PutIndexDataForRecord(
107 Transaction*,
108 int64 database_id,
109 int64 object_store_id,
110 int64 index_id,
111 const IndexedDBKey&,
112 const RecordIdentifier&) {
113 return leveldb::Status::IOError("test error");
116 scoped_ptr<IndexedDBBackingStore::Cursor>
117 IndexedDBFakeBackingStore::OpenObjectStoreKeyCursor(
118 IndexedDBBackingStore::Transaction* transaction,
119 int64 database_id,
120 int64 object_store_id,
121 const IndexedDBKeyRange& key_range,
122 indexed_db::CursorDirection) {
123 return scoped_ptr<IndexedDBBackingStore::Cursor>();
125 scoped_ptr<IndexedDBBackingStore::Cursor>
126 IndexedDBFakeBackingStore::OpenObjectStoreCursor(
127 IndexedDBBackingStore::Transaction* transaction,
128 int64 database_id,
129 int64 object_store_id,
130 const IndexedDBKeyRange& key_range,
131 indexed_db::CursorDirection) {
132 return scoped_ptr<IndexedDBBackingStore::Cursor>();
134 scoped_ptr<IndexedDBBackingStore::Cursor>
135 IndexedDBFakeBackingStore::OpenIndexKeyCursor(
136 IndexedDBBackingStore::Transaction* transaction,
137 int64 database_id,
138 int64 object_store_id,
139 int64 index_id,
140 const IndexedDBKeyRange& key_range,
141 indexed_db::CursorDirection) {
142 return scoped_ptr<IndexedDBBackingStore::Cursor>();
144 scoped_ptr<IndexedDBBackingStore::Cursor>
145 IndexedDBFakeBackingStore::OpenIndexCursor(
146 IndexedDBBackingStore::Transaction* transaction,
147 int64 database_id,
148 int64 object_store_id,
149 int64 index_id,
150 const IndexedDBKeyRange& key_range,
151 indexed_db::CursorDirection) {
152 return scoped_ptr<IndexedDBBackingStore::Cursor>();
155 IndexedDBFakeBackingStore::FakeTransaction::FakeTransaction(bool result)
156 : IndexedDBBackingStore::Transaction(NULL), result_(result) {}
157 void IndexedDBFakeBackingStore::FakeTransaction::Begin() {}
158 leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::Commit() {
159 if (result_)
160 return leveldb::Status::OK();
161 else
162 return leveldb::Status::IOError("test error");
164 void IndexedDBFakeBackingStore::FakeTransaction::Rollback() {}
166 } // namespace content