OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
jsbell
2013/05/28 19:27:32
Naming convention in chromium is fake_XXXX.h/.cc -
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | |
7 | |
8 #include "content/browser/indexed_db/indexed_db_backing_store.h" | |
9 | |
10 namespace content { | |
11 | |
12 class IndexedDBFakeBackingStore : public IndexedDBBackingStore { | |
13 public: | |
14 IndexedDBFakeBackingStore() | |
15 : IndexedDBBackingStore(string16(), | |
16 scoped_ptr<LevelDBDatabase>(), | |
17 scoped_ptr<LevelDBComparator>()) {} | |
18 virtual std::vector<string16> GetDatabaseNames() OVERRIDE; | |
19 virtual bool GetIDBDatabaseMetaData(const string16& name, | |
20 IndexedDBDatabaseMetadata*, | |
21 bool& found) OVERRIDE; | |
22 virtual bool CreateIDBDatabaseMetaData(const string16& name, | |
23 const string16& version, | |
24 int64_t int_version, | |
25 int64_t& row_id) OVERRIDE; | |
26 virtual bool UpdateIDBDatabaseMetaData(Transaction*, | |
27 int64_t row_id, | |
28 const string16& version) OVERRIDE; | |
29 virtual bool UpdateIDBDatabaseIntVersion(Transaction*, | |
30 int64_t row_id, | |
31 int64_t version) OVERRIDE; | |
32 virtual bool DeleteDatabase(const string16& name) OVERRIDE; | |
33 | |
34 virtual bool CreateObjectStore(Transaction*, | |
35 int64_t database_id, | |
36 int64_t object_store_id, | |
37 const string16& name, | |
38 const IndexedDBKeyPath&, | |
39 bool auto_increment) OVERRIDE; | |
40 | |
41 virtual bool ClearObjectStore(Transaction*, | |
42 int64_t database_id, | |
43 int64_t object_store_id) OVERRIDE; | |
44 virtual bool DeleteRecord(Transaction*, | |
45 int64_t database_id, | |
46 int64_t object_store_id, | |
47 const RecordIdentifier&) OVERRIDE; | |
48 virtual bool GetKeyGeneratorCurrentNumber(Transaction*, | |
49 int64_t database_id, | |
50 int64_t object_store_id, | |
51 int64_t& current_number) OVERRIDE; | |
52 virtual bool MaybeUpdateKeyGeneratorCurrentNumber(Transaction*, | |
53 int64_t database_id, | |
54 int64_t object_store_id, | |
55 int64_t new_number, | |
56 bool check_current) | |
57 OVERRIDE; | |
58 virtual bool KeyExistsInObjectStore(Transaction*, | |
59 int64_t database_id, | |
60 int64_t object_store_id, | |
61 const IndexedDBKey&, | |
62 RecordIdentifier* found_record_identifier, | |
63 bool& found) OVERRIDE; | |
64 | |
65 virtual bool CreateIndex(Transaction*, | |
66 int64_t database_id, | |
67 int64_t object_store_id, | |
68 int64_t index_id, | |
69 const string16& name, | |
70 const IndexedDBKeyPath&, | |
71 bool is_unique, | |
72 bool is_multi_entry) OVERRIDE; | |
73 virtual bool DeleteIndex(Transaction*, | |
74 int64_t database_id, | |
75 int64_t object_store_id, | |
76 int64_t index_id) OVERRIDE; | |
77 virtual bool PutIndexDataForRecord(Transaction*, | |
78 int64_t database_id, | |
79 int64_t object_store_id, | |
80 int64_t index_id, | |
81 const IndexedDBKey&, | |
82 const RecordIdentifier&) OVERRIDE; | |
83 | |
84 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( | |
85 Transaction* transaction, | |
86 int64 database_id, | |
87 int64 object_store_id, | |
88 const IndexedDBKeyRange& key_range, | |
89 indexed_db::CursorDirection) OVERRIDE; | |
90 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( | |
91 Transaction* transaction, | |
92 int64 database_id, | |
93 int64 object_store_id, | |
94 const IndexedDBKeyRange& key_range, | |
95 indexed_db::CursorDirection) OVERRIDE; | |
96 virtual scoped_ptr<Cursor> OpenIndexKeyCursor( | |
97 Transaction* transaction, | |
98 int64 database_id, | |
99 int64 object_store_id, | |
100 int64 index_id, | |
101 const IndexedDBKeyRange& key_range, | |
102 indexed_db::CursorDirection) OVERRIDE; | |
103 virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, | |
104 int64 database_id, | |
105 int64 object_store_id, | |
106 int64 index_id, | |
107 const IndexedDBKeyRange& key_range, | |
108 indexed_db::CursorDirection) | |
109 OVERRIDE; | |
110 | |
111 protected: | |
112 friend class base::RefCounted<IndexedDBFakeBackingStore>; | |
113 | |
114 private: | |
115 virtual ~IndexedDBFakeBackingStore(); | |
116 }; | |
117 | |
118 } // namespace content | |
119 | |
120 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | |
OLD | NEW |