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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/browser/indexed_db/indexed_db_backing_store.h" 10 #include "content/browser/indexed_db/indexed_db_backing_store.h"
11 11
12 namespace base { 12 namespace base {
13 class SequencedTaskRunner; 13 class SequencedTaskRunner;
14 } 14 }
15 15
16 namespace content { 16 namespace content {
17 17
18 class IndexedDBFactory; 18 class IndexedDBFactory;
19 19
20 class IndexedDBFakeBackingStore : public IndexedDBBackingStore { 20 class IndexedDBFakeBackingStore : public IndexedDBBackingStore {
21 public: 21 public:
22 IndexedDBFakeBackingStore(); 22 IndexedDBFakeBackingStore();
23 IndexedDBFakeBackingStore(IndexedDBFactory* factory, 23 IndexedDBFakeBackingStore(IndexedDBFactory* factory,
24 base::SequencedTaskRunner* task_runner); 24 base::SequencedTaskRunner* task_runner);
25 virtual std::vector<base::string16> GetDatabaseNames(leveldb::Status* s) 25 std::vector<base::string16> GetDatabaseNames(leveldb::Status* s) override;
26 override; 26 leveldb::Status GetIDBDatabaseMetaData(const base::string16& name,
27 virtual leveldb::Status GetIDBDatabaseMetaData(const base::string16& name, 27 IndexedDBDatabaseMetadata*,
28 IndexedDBDatabaseMetadata*, 28 bool* found) override;
29 bool* found) override; 29 leveldb::Status CreateIDBDatabaseMetaData(const base::string16& name,
30 virtual leveldb::Status CreateIDBDatabaseMetaData( 30 const base::string16& version,
31 const base::string16& name, 31 int64 int_version,
32 const base::string16& version, 32 int64* row_id) override;
33 int64 int_version, 33 bool UpdateIDBDatabaseIntVersion(Transaction*,
34 int64* row_id) override; 34 int64 row_id,
35 virtual bool UpdateIDBDatabaseIntVersion(Transaction*, 35 int64 version) override;
36 int64 row_id, 36 leveldb::Status DeleteDatabase(const base::string16& name) override;
37 int64 version) override;
38 virtual leveldb::Status DeleteDatabase(const base::string16& name) override;
39 37
40 virtual leveldb::Status CreateObjectStore(Transaction*, 38 leveldb::Status CreateObjectStore(Transaction*,
41 int64 database_id, 39 int64 database_id,
42 int64 object_store_id, 40 int64 object_store_id,
43 const base::string16& name, 41 const base::string16& name,
44 const IndexedDBKeyPath&, 42 const IndexedDBKeyPath&,
45 bool auto_increment) override; 43 bool auto_increment) override;
46 44
47 virtual leveldb::Status DeleteObjectStore(Transaction* transaction, 45 leveldb::Status DeleteObjectStore(Transaction* transaction,
48 int64 database_id, 46 int64 database_id,
49 int64 object_store_id) override; 47 int64 object_store_id) override;
50 48
51 virtual leveldb::Status PutRecord( 49 leveldb::Status PutRecord(IndexedDBBackingStore::Transaction* transaction,
52 IndexedDBBackingStore::Transaction* transaction, 50 int64 database_id,
53 int64 database_id, 51 int64 object_store_id,
54 int64 object_store_id, 52 const IndexedDBKey& key,
55 const IndexedDBKey& key, 53 IndexedDBValue* value,
56 IndexedDBValue* value, 54 ScopedVector<storage::BlobDataHandle>* handles,
57 ScopedVector<storage::BlobDataHandle>* handles, 55 RecordIdentifier* record) override;
58 RecordIdentifier* record) override;
59 56
60 virtual leveldb::Status ClearObjectStore(Transaction*, 57 leveldb::Status ClearObjectStore(Transaction*,
61 int64 database_id, 58 int64 database_id,
62 int64 object_store_id) override; 59 int64 object_store_id) override;
63 virtual leveldb::Status DeleteRecord(Transaction*, 60 leveldb::Status DeleteRecord(Transaction*,
64 int64 database_id, 61 int64 database_id,
65 int64 object_store_id, 62 int64 object_store_id,
66 const RecordIdentifier&) override; 63 const RecordIdentifier&) override;
67 virtual leveldb::Status GetKeyGeneratorCurrentNumber(Transaction*, 64 leveldb::Status GetKeyGeneratorCurrentNumber(Transaction*,
68 int64 database_id, 65 int64 database_id,
69 int64 object_store_id, 66 int64 object_store_id,
70 int64* current_number) 67 int64* current_number) override;
71 override; 68 leveldb::Status MaybeUpdateKeyGeneratorCurrentNumber(
72 virtual leveldb::Status MaybeUpdateKeyGeneratorCurrentNumber(
73 Transaction*, 69 Transaction*,
74 int64 database_id, 70 int64 database_id,
75 int64 object_store_id, 71 int64 object_store_id,
76 int64 new_number, 72 int64 new_number,
77 bool check_current) override; 73 bool check_current) override;
78 virtual leveldb::Status KeyExistsInObjectStore( 74 leveldb::Status KeyExistsInObjectStore(
79 Transaction*, 75 Transaction*,
80 int64 database_id, 76 int64 database_id,
81 int64 object_store_id, 77 int64 object_store_id,
82 const IndexedDBKey&, 78 const IndexedDBKey&,
83 RecordIdentifier* found_record_identifier, 79 RecordIdentifier* found_record_identifier,
84 bool* found) override; 80 bool* found) override;
85 81
86 virtual leveldb::Status CreateIndex(Transaction*, 82 leveldb::Status CreateIndex(Transaction*,
87 int64 database_id, 83 int64 database_id,
88 int64 object_store_id, 84 int64 object_store_id,
89 int64 index_id, 85 int64 index_id,
90 const base::string16& name, 86 const base::string16& name,
91 const IndexedDBKeyPath&, 87 const IndexedDBKeyPath&,
92 bool is_unique, 88 bool is_unique,
93 bool is_multi_entry) override; 89 bool is_multi_entry) override;
94 virtual leveldb::Status DeleteIndex(Transaction*, 90 leveldb::Status DeleteIndex(Transaction*,
95 int64 database_id, 91 int64 database_id,
96 int64 object_store_id, 92 int64 object_store_id,
97 int64 index_id) override; 93 int64 index_id) override;
98 virtual leveldb::Status PutIndexDataForRecord(Transaction*, 94 leveldb::Status PutIndexDataForRecord(Transaction*,
99 int64 database_id, 95 int64 database_id,
100 int64 object_store_id, 96 int64 object_store_id,
101 int64 index_id, 97 int64 index_id,
102 const IndexedDBKey&, 98 const IndexedDBKey&,
103 const RecordIdentifier&) 99 const RecordIdentifier&) override;
104 override; 100 void ReportBlobUnused(int64 database_id, int64 blob_key) override;
105 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) override; 101 scoped_ptr<Cursor> OpenObjectStoreKeyCursor(
106 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor(
107 Transaction* transaction, 102 Transaction* transaction,
108 int64 database_id, 103 int64 database_id,
109 int64 object_store_id, 104 int64 object_store_id,
110 const IndexedDBKeyRange& key_range, 105 const IndexedDBKeyRange& key_range,
111 blink::WebIDBCursorDirection, 106 blink::WebIDBCursorDirection,
112 leveldb::Status*) override; 107 leveldb::Status*) override;
113 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( 108 scoped_ptr<Cursor> OpenObjectStoreCursor(Transaction* transaction,
114 Transaction* transaction, 109 int64 database_id,
115 int64 database_id, 110 int64 object_store_id,
116 int64 object_store_id, 111 const IndexedDBKeyRange& key_range,
117 const IndexedDBKeyRange& key_range, 112 blink::WebIDBCursorDirection,
118 blink::WebIDBCursorDirection, 113 leveldb::Status*) override;
119 leveldb::Status*) override; 114 scoped_ptr<Cursor> OpenIndexKeyCursor(Transaction* transaction,
120 virtual scoped_ptr<Cursor> OpenIndexKeyCursor( 115 int64 database_id,
121 Transaction* transaction, 116 int64 object_store_id,
122 int64 database_id, 117 int64 index_id,
123 int64 object_store_id, 118 const IndexedDBKeyRange& key_range,
124 int64 index_id, 119 blink::WebIDBCursorDirection,
125 const IndexedDBKeyRange& key_range, 120 leveldb::Status*) override;
126 blink::WebIDBCursorDirection, 121 scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction,
127 leveldb::Status*) override; 122 int64 database_id,
128 virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, 123 int64 object_store_id,
129 int64 database_id, 124 int64 index_id,
130 int64 object_store_id, 125 const IndexedDBKeyRange& key_range,
131 int64 index_id, 126 blink::WebIDBCursorDirection,
132 const IndexedDBKeyRange& key_range, 127 leveldb::Status*) override;
133 blink::WebIDBCursorDirection,
134 leveldb::Status*) override;
135 128
136 class FakeTransaction : public IndexedDBBackingStore::Transaction { 129 class FakeTransaction : public IndexedDBBackingStore::Transaction {
137 public: 130 public:
138 explicit FakeTransaction(leveldb::Status phase_two_result); 131 explicit FakeTransaction(leveldb::Status phase_two_result);
139 virtual void Begin() override; 132 void Begin() override;
140 virtual leveldb::Status CommitPhaseOne( 133 leveldb::Status CommitPhaseOne(scoped_refptr<BlobWriteCallback>) override;
141 scoped_refptr<BlobWriteCallback>) override; 134 leveldb::Status CommitPhaseTwo() override;
142 virtual leveldb::Status CommitPhaseTwo() override; 135 void Rollback() override;
143 virtual void Rollback() override;
144 136
145 private: 137 private:
146 leveldb::Status result_; 138 leveldb::Status result_;
147 139
148 DISALLOW_COPY_AND_ASSIGN(FakeTransaction); 140 DISALLOW_COPY_AND_ASSIGN(FakeTransaction);
149 }; 141 };
150 142
151 protected: 143 protected:
152 friend class base::RefCounted<IndexedDBFakeBackingStore>; 144 friend class base::RefCounted<IndexedDBFakeBackingStore>;
153 virtual ~IndexedDBFakeBackingStore(); 145 ~IndexedDBFakeBackingStore() override;
154 146
155 private: 147 private:
156 DISALLOW_COPY_AND_ASSIGN(IndexedDBFakeBackingStore); 148 DISALLOW_COPY_AND_ASSIGN(IndexedDBFakeBackingStore);
157 }; 149 };
158 150
159 } // namespace content 151 } // namespace content
160 152
161 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ 153 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory_unittest.cc ('k') | content/browser/indexed_db/indexed_db_internals_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698