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

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

Issue 18241003: IndexedDB: Remove IndexedDBCallbacksWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include/Forward Declare tidying Created 7 years, 5 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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_DATABASE_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "content/browser/indexed_db/indexed_db.h" 14 #include "content/browser/indexed_db/indexed_db.h"
15 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" 15 #include "content/browser/indexed_db/indexed_db_callbacks.h"
16 #include "content/browser/indexed_db/indexed_db_metadata.h" 16 #include "content/browser/indexed_db/indexed_db_metadata.h"
17 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" 17 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
18 #include "content/browser/indexed_db/list_set.h" 18 #include "content/browser/indexed_db/list_set.h"
19 19
20 namespace content { 20 namespace content {
21 21
22 class IndexedDBCallbacksWrapper;
23 class IndexedDBDatabaseCallbacks; 22 class IndexedDBDatabaseCallbacks;
24 class IndexedDBBackingStore; 23 class IndexedDBBackingStore;
25 class IndexedDBFactory; 24 class IndexedDBFactory;
26 class IndexedDBKey; 25 class IndexedDBKey;
27 class IndexedDBKeyPath; 26 class IndexedDBKeyPath;
28 class IndexedDBKeyRange; 27 class IndexedDBKeyRange;
29 class IndexedDBTransaction; 28 class IndexedDBTransaction;
30 29
31 class CONTENT_EXPORT IndexedDBDatabase 30 class CONTENT_EXPORT IndexedDBDatabase
32 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { 31 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) {
(...skipping 24 matching lines...) Expand all
57 int64 id() const { return metadata_.id; } 56 int64 id() const { return metadata_.id; }
58 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, 57 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata,
59 int64 new_max_object_store_id); 58 int64 new_max_object_store_id);
60 void RemoveObjectStore(int64 object_store_id); 59 void RemoveObjectStore(int64 object_store_id);
61 void AddIndex(int64 object_store_id, 60 void AddIndex(int64 object_store_id,
62 const IndexedDBIndexMetadata& metadata, 61 const IndexedDBIndexMetadata& metadata,
63 int64 new_max_index_id); 62 int64 new_max_index_id);
64 void RemoveIndex(int64 object_store_id, int64 index_id); 63 void RemoveIndex(int64 object_store_id, int64 index_id);
65 64
66 void OpenConnection( 65 void OpenConnection(
67 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 66 scoped_refptr<IndexedDBCallbacks> callbacks,
68 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, 67 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
69 int64 transaction_id, 68 int64 transaction_id,
70 int64 version); 69 int64 version);
71 void OpenConnection( 70 void OpenConnection(
72 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 71 scoped_refptr<IndexedDBCallbacks> callbacks,
73 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, 72 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
74 int64 transaction_id, 73 int64 transaction_id,
75 int64 version, 74 int64 version,
76 WebKit::WebIDBCallbacks::DataLoss data_loss); 75 WebKit::WebIDBCallbacks::DataLoss data_loss);
77 void DeleteDatabase(scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 76 void DeleteDatabase(scoped_refptr<IndexedDBCallbacks> callbacks);
78 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; } 77 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; }
79 78
80 void CreateObjectStore(int64 transaction_id, 79 void CreateObjectStore(int64 transaction_id,
81 int64 object_store_id, 80 int64 object_store_id,
82 const string16& name, 81 const string16& name,
83 const IndexedDBKeyPath& key_path, 82 const IndexedDBKeyPath& key_path,
84 bool auto_increment); 83 bool auto_increment);
85 void DeleteObjectStore(int64 transaction_id, int64 object_store_id); 84 void DeleteObjectStore(int64 transaction_id, int64 object_store_id);
86 void CreateTransaction( 85 void CreateTransaction(int64 transaction_id,
87 int64 transaction_id, 86 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks,
88 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks, 87 const std::vector<int64>& object_store_ids,
89 const std::vector<int64>& object_store_ids, 88 uint16 mode);
90 uint16 mode);
91 void Close(scoped_refptr<IndexedDBDatabaseCallbacks> callbacks); 89 void Close(scoped_refptr<IndexedDBDatabaseCallbacks> callbacks);
92 90
93 void Commit(int64 transaction_id); 91 void Commit(int64 transaction_id);
94 void Abort(int64 transaction_id); 92 void Abort(int64 transaction_id);
95 void Abort(int64 transaction_id, const IndexedDBDatabaseError& error); 93 void Abort(int64 transaction_id, const IndexedDBDatabaseError& error);
96 94
97 void CreateIndex(int64 transaction_id, 95 void CreateIndex(int64 transaction_id,
98 int64 object_store_id, 96 int64 object_store_id,
99 int64 index_id, 97 int64 index_id,
100 const string16& name, 98 const string16& name,
101 const IndexedDBKeyPath& key_path, 99 const IndexedDBKeyPath& key_path,
102 bool unique, 100 bool unique,
103 bool multi_entry); 101 bool multi_entry);
104 void DeleteIndex(int64 transaction_id, int64 object_store_id, int64 index_id); 102 void DeleteIndex(int64 transaction_id, int64 object_store_id, int64 index_id);
105 103
106 IndexedDBTransactionCoordinator& transaction_coordinator() { 104 IndexedDBTransactionCoordinator& transaction_coordinator() {
107 return transaction_coordinator_; 105 return transaction_coordinator_;
108 } 106 }
109 107
110 void TransactionStarted(IndexedDBTransaction* transaction); 108 void TransactionStarted(IndexedDBTransaction* transaction);
111 void TransactionFinished(IndexedDBTransaction* transaction); 109 void TransactionFinished(IndexedDBTransaction* transaction);
112 void TransactionFinishedAndCompleteFired(IndexedDBTransaction* transaction); 110 void TransactionFinishedAndCompleteFired(IndexedDBTransaction* transaction);
113 void TransactionFinishedAndAbortFired(IndexedDBTransaction* transaction); 111 void TransactionFinishedAndAbortFired(IndexedDBTransaction* transaction);
114 112
115 void Get(int64 transaction_id, 113 void Get(int64 transaction_id,
116 int64 object_store_id, 114 int64 object_store_id,
117 int64 index_id, 115 int64 index_id,
118 scoped_ptr<IndexedDBKeyRange> key_range, 116 scoped_ptr<IndexedDBKeyRange> key_range,
119 bool key_only, 117 bool key_only,
120 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 118 scoped_refptr<IndexedDBCallbacks> callbacks);
121 void Put(int64 transaction_id, 119 void Put(int64 transaction_id,
122 int64 object_store_id, 120 int64 object_store_id,
123 std::vector<char>* value, 121 std::vector<char>* value,
124 scoped_ptr<IndexedDBKey> key, 122 scoped_ptr<IndexedDBKey> key,
125 PutMode mode, 123 PutMode mode,
126 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 124 scoped_refptr<IndexedDBCallbacks> callbacks,
127 const std::vector<int64>& index_ids, 125 const std::vector<int64>& index_ids,
128 const std::vector<IndexKeys>& index_keys); 126 const std::vector<IndexKeys>& index_keys);
129 void SetIndexKeys(int64 transaction_id, 127 void SetIndexKeys(int64 transaction_id,
130 int64 object_store_id, 128 int64 object_store_id,
131 scoped_ptr<IndexedDBKey> primary_key, 129 scoped_ptr<IndexedDBKey> primary_key,
132 const std::vector<int64>& index_ids, 130 const std::vector<int64>& index_ids,
133 const std::vector<IndexKeys>& index_keys); 131 const std::vector<IndexKeys>& index_keys);
134 void SetIndexesReady(int64 transaction_id, 132 void SetIndexesReady(int64 transaction_id,
135 int64 object_store_id, 133 int64 object_store_id,
136 const std::vector<int64>& index_ids); 134 const std::vector<int64>& index_ids);
137 void OpenCursor(int64 transaction_id, 135 void OpenCursor(int64 transaction_id,
138 int64 object_store_id, 136 int64 object_store_id,
139 int64 index_id, 137 int64 index_id,
140 scoped_ptr<IndexedDBKeyRange> key_range, 138 scoped_ptr<IndexedDBKeyRange> key_range,
141 indexed_db::CursorDirection, 139 indexed_db::CursorDirection,
142 bool key_only, 140 bool key_only,
143 TaskType task_type, 141 TaskType task_type,
144 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 142 scoped_refptr<IndexedDBCallbacks> callbacks);
145 void Count(int64 transaction_id, 143 void Count(int64 transaction_id,
146 int64 object_store_id, 144 int64 object_store_id,
147 int64 index_id, 145 int64 index_id,
148 scoped_ptr<IndexedDBKeyRange> key_range, 146 scoped_ptr<IndexedDBKeyRange> key_range,
149 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 147 scoped_refptr<IndexedDBCallbacks> callbacks);
150 void DeleteRange(int64 transaction_id, 148 void DeleteRange(int64 transaction_id,
151 int64 object_store_id, 149 int64 object_store_id,
152 scoped_ptr<IndexedDBKeyRange> key_range, 150 scoped_ptr<IndexedDBKeyRange> key_range,
153 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 151 scoped_refptr<IndexedDBCallbacks> callbacks);
154 void Clear(int64 transaction_id, 152 void Clear(int64 transaction_id,
155 int64 object_store_id, 153 int64 object_store_id,
156 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 154 scoped_refptr<IndexedDBCallbacks> callbacks);
157 155
158 private: 156 private:
159 friend class base::RefCounted<IndexedDBDatabase>; 157 friend class base::RefCounted<IndexedDBDatabase>;
160 158
161 IndexedDBDatabase(const string16& name, 159 IndexedDBDatabase(const string16& name,
162 IndexedDBBackingStore* database, 160 IndexedDBBackingStore* database,
163 IndexedDBFactory* factory, 161 IndexedDBFactory* factory,
164 const string16& unique_identifier); 162 const string16& unique_identifier);
165 ~IndexedDBDatabase(); 163 ~IndexedDBDatabase();
166 164
167 bool IsOpenConnectionBlocked() const; 165 bool IsOpenConnectionBlocked() const;
168 bool OpenInternal(); 166 bool OpenInternal();
169 void RunVersionChangeTransaction( 167 void RunVersionChangeTransaction(
170 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 168 scoped_refptr<IndexedDBCallbacks> callbacks,
171 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, 169 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
172 int64 transaction_id, 170 int64 transaction_id,
173 int64 requested_version, 171 int64 requested_version,
174 WebKit::WebIDBCallbacks::DataLoss data_loss); 172 WebKit::WebIDBCallbacks::DataLoss data_loss);
175 void RunVersionChangeTransactionFinal( 173 void RunVersionChangeTransactionFinal(
176 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 174 scoped_refptr<IndexedDBCallbacks> callbacks,
177 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, 175 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
178 int64 transaction_id, 176 int64 transaction_id,
179 int64 requested_version); 177 int64 requested_version);
180 void RunVersionChangeTransactionFinal( 178 void RunVersionChangeTransactionFinal(
181 scoped_refptr<IndexedDBCallbacksWrapper> callbacks, 179 scoped_refptr<IndexedDBCallbacks> callbacks,
182 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, 180 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
183 int64 transaction_id, 181 int64 transaction_id,
184 int64 requested_version, 182 int64 requested_version,
185 WebKit::WebIDBCallbacks::DataLoss data_loss); 183 WebKit::WebIDBCallbacks::DataLoss data_loss);
186 size_t ConnectionCount() const; 184 size_t ConnectionCount() const;
187 void ProcessPendingCalls(); 185 void ProcessPendingCalls();
188 186
189 bool IsDeleteDatabaseBlocked() const; 187 bool IsDeleteDatabaseBlocked() const;
190 void DeleteDatabaseFinal(scoped_refptr<IndexedDBCallbacksWrapper> callbacks); 188 void DeleteDatabaseFinal(scoped_refptr<IndexedDBCallbacks> callbacks);
191 189
192 class VersionChangeOperation; 190 class VersionChangeOperation;
193 191
194 // When a "versionchange" transaction aborts, these restore the back-end 192 // When a "versionchange" transaction aborts, these restore the back-end
195 // object hierarchy. 193 // object hierarchy.
196 class VersionChangeAbortOperation; 194 class VersionChangeAbortOperation;
197 195
198 scoped_refptr<IndexedDBBackingStore> backing_store_; 196 scoped_refptr<IndexedDBBackingStore> backing_store_;
199 IndexedDBDatabaseMetadata metadata_; 197 IndexedDBDatabaseMetadata metadata_;
200 198
(...skipping 21 matching lines...) Expand all
222 typedef list_set<scoped_refptr<IndexedDBDatabaseCallbacks> > 220 typedef list_set<scoped_refptr<IndexedDBDatabaseCallbacks> >
223 DatabaseCallbacksSet; 221 DatabaseCallbacksSet;
224 DatabaseCallbacksSet database_callbacks_set_; 222 DatabaseCallbacksSet database_callbacks_set_;
225 223
226 bool closing_connection_; 224 bool closing_connection_;
227 }; 225 };
228 226
229 } // namespace content 227 } // namespace content
230 228
231 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ 229 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_cursor.cc ('k') | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698