Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: content/browser/indexed_db/indexed_db_fake_backing_store.h

Issue 15724006: Migrate IDBDatabaseBackendTest from blink to chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update to ToT, fix review comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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.
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 <vector>
9
10 #include "content/browser/indexed_db/indexed_db_backing_store.h"
11
12 namespace content {
13
14 class IndexedDBFakeBackingStore : public IndexedDBBackingStore {
15 public:
16 IndexedDBFakeBackingStore()
17 : IndexedDBBackingStore(string16(),
18 scoped_ptr<LevelDBDatabase>(),
19 scoped_ptr<LevelDBComparator>()) {}
20 virtual std::vector<string16> GetDatabaseNames() OVERRIDE;
21 virtual bool GetIDBDatabaseMetaData(const string16& name,
22 IndexedDBDatabaseMetadata*,
23 bool& found) OVERRIDE;
24 virtual bool CreateIDBDatabaseMetaData(const string16& name,
25 const string16& version,
26 int64_t int_version,
27 int64_t& row_id) OVERRIDE;
28 virtual bool UpdateIDBDatabaseMetaData(Transaction*,
29 int64_t row_id,
30 const string16& version) OVERRIDE;
31 virtual bool UpdateIDBDatabaseIntVersion(Transaction*,
32 int64_t row_id,
33 int64_t version) OVERRIDE;
34 virtual bool DeleteDatabase(const string16& name) OVERRIDE;
35
36 virtual bool CreateObjectStore(Transaction*,
37 int64_t database_id,
38 int64_t object_store_id,
39 const string16& name,
40 const IndexedDBKeyPath&,
41 bool auto_increment) OVERRIDE;
42
43 virtual bool ClearObjectStore(Transaction*,
44 int64_t database_id,
45 int64_t object_store_id) OVERRIDE;
46 virtual bool DeleteRecord(Transaction*,
47 int64_t database_id,
48 int64_t object_store_id,
49 const RecordIdentifier&) OVERRIDE;
50 virtual bool GetKeyGeneratorCurrentNumber(Transaction*,
51 int64_t database_id,
52 int64_t object_store_id,
53 int64_t& current_number) OVERRIDE;
54 virtual bool MaybeUpdateKeyGeneratorCurrentNumber(Transaction*,
55 int64_t database_id,
56 int64_t object_store_id,
57 int64_t new_number,
58 bool check_current)
59 OVERRIDE;
piman 2013/05/31 22:31:55 nit: odd style is odd. We usually wrap the paramet
jsbell 2013/05/31 22:36:12 Probably clang-format. I'll send them a bug.
60 virtual bool KeyExistsInObjectStore(Transaction*,
61 int64_t database_id,
62 int64_t object_store_id,
63 const IndexedDBKey&,
64 RecordIdentifier* found_record_identifier,
65 bool& found) OVERRIDE;
66
67 virtual bool CreateIndex(Transaction*,
68 int64_t database_id,
69 int64_t object_store_id,
70 int64_t index_id,
71 const string16& name,
72 const IndexedDBKeyPath&,
73 bool is_unique,
74 bool is_multi_entry) OVERRIDE;
75 virtual bool DeleteIndex(Transaction*,
76 int64_t database_id,
77 int64_t object_store_id,
78 int64_t index_id) OVERRIDE;
79 virtual bool PutIndexDataForRecord(Transaction*,
80 int64_t database_id,
81 int64_t object_store_id,
82 int64_t index_id,
83 const IndexedDBKey&,
84 const RecordIdentifier&) OVERRIDE;
85
86 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor(
87 Transaction* transaction,
88 int64 database_id,
89 int64 object_store_id,
90 const IndexedDBKeyRange& key_range,
91 indexed_db::CursorDirection) OVERRIDE;
92 virtual scoped_ptr<Cursor> OpenObjectStoreCursor(
93 Transaction* transaction,
94 int64 database_id,
95 int64 object_store_id,
96 const IndexedDBKeyRange& key_range,
97 indexed_db::CursorDirection) OVERRIDE;
98 virtual scoped_ptr<Cursor> OpenIndexKeyCursor(
99 Transaction* transaction,
100 int64 database_id,
101 int64 object_store_id,
102 int64 index_id,
103 const IndexedDBKeyRange& key_range,
104 indexed_db::CursorDirection) OVERRIDE;
105 virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction,
106 int64 database_id,
107 int64 object_store_id,
108 int64 index_id,
109 const IndexedDBKeyRange& key_range,
110 indexed_db::CursorDirection)
111 OVERRIDE;
piman 2013/05/31 22:31:55 ditto
112
113 protected:
114 friend class base::RefCounted<IndexedDBFakeBackingStore>;
115 virtual ~IndexedDBFakeBackingStore();
116 };
117
118 } // namespace content
119
120 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698