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

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

Issue 198223002: Added IndexedDBPendingConnection to group up a bunch of parameters that get (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge out Created 6 years, 9 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "content/browser/indexed_db/indexed_db.h" 16 #include "content/browser/indexed_db/indexed_db.h"
17 #include "content/browser/indexed_db/indexed_db_backing_store.h" 17 #include "content/browser/indexed_db/indexed_db_backing_store.h"
18 #include "content/browser/indexed_db/indexed_db_callbacks.h" 18 #include "content/browser/indexed_db/indexed_db_callbacks.h"
19 #include "content/browser/indexed_db/indexed_db_metadata.h" 19 #include "content/browser/indexed_db/indexed_db_metadata.h"
20 #include "content/browser/indexed_db/indexed_db_pending_connection.h"
20 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" 21 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
21 #include "content/browser/indexed_db/list_set.h" 22 #include "content/browser/indexed_db/list_set.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
23 24
24 namespace content { 25 namespace content {
25 26
26 class IndexedDBConnection; 27 class IndexedDBConnection;
27 class IndexedDBDatabaseCallbacks; 28 class IndexedDBDatabaseCallbacks;
28 class IndexedDBFactory; 29 class IndexedDBFactory;
29 class IndexedDBKey; 30 class IndexedDBKey;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const base::string16& name() const { return metadata_.name; } 68 const base::string16& name() const { return metadata_.name; }
68 69
69 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, 70 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata,
70 int64 new_max_object_store_id); 71 int64 new_max_object_store_id);
71 void RemoveObjectStore(int64 object_store_id); 72 void RemoveObjectStore(int64 object_store_id);
72 void AddIndex(int64 object_store_id, 73 void AddIndex(int64 object_store_id,
73 const IndexedDBIndexMetadata& metadata, 74 const IndexedDBIndexMetadata& metadata,
74 int64 new_max_index_id); 75 int64 new_max_index_id);
75 void RemoveIndex(int64 object_store_id, int64 index_id); 76 void RemoveIndex(int64 object_store_id, int64 index_id);
76 77
77 void OpenConnection( 78 void OpenConnection(const IndexedDBPendingConnection& connection);
78 scoped_refptr<IndexedDBCallbacks> callbacks,
79 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
80 int64 transaction_id,
81 int64 version);
82 void DeleteDatabase(scoped_refptr<IndexedDBCallbacks> callbacks); 79 void DeleteDatabase(scoped_refptr<IndexedDBCallbacks> callbacks);
83 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; } 80 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; }
84 81
85 void CreateObjectStore(int64 transaction_id, 82 void CreateObjectStore(int64 transaction_id,
86 int64 object_store_id, 83 int64 object_store_id,
87 const base::string16& name, 84 const base::string16& name,
88 const IndexedDBKeyPath& key_path, 85 const IndexedDBKeyPath& key_path,
89 bool auto_increment); 86 bool auto_increment);
90 void DeleteObjectStore(int64 transaction_id, int64 object_store_id); 87 void DeleteObjectStore(int64 transaction_id, int64 object_store_id);
91 void CreateTransaction(int64 transaction_id, 88 void CreateTransaction(int64 transaction_id,
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 void RunVersionChangeTransactionFinal( 246 void RunVersionChangeTransactionFinal(
250 scoped_refptr<IndexedDBCallbacks> callbacks, 247 scoped_refptr<IndexedDBCallbacks> callbacks,
251 scoped_ptr<IndexedDBConnection> connection, 248 scoped_ptr<IndexedDBConnection> connection,
252 int64 transaction_id, 249 int64 transaction_id,
253 int64 requested_version); 250 int64 requested_version);
254 void ProcessPendingCalls(); 251 void ProcessPendingCalls();
255 252
256 bool IsDeleteDatabaseBlocked() const; 253 bool IsDeleteDatabaseBlocked() const;
257 void DeleteDatabaseFinal(scoped_refptr<IndexedDBCallbacks> callbacks); 254 void DeleteDatabaseFinal(scoped_refptr<IndexedDBCallbacks> callbacks);
258 255
256 scoped_ptr<IndexedDBConnection> CreateConnection(
257 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
258 int child_process_id);
259
259 IndexedDBTransaction* GetTransaction(int64 transaction_id) const; 260 IndexedDBTransaction* GetTransaction(int64 transaction_id) const;
260 261
261 bool ValidateObjectStoreId(int64 object_store_id) const; 262 bool ValidateObjectStoreId(int64 object_store_id) const;
262 bool ValidateObjectStoreIdAndIndexId(int64 object_store_id, 263 bool ValidateObjectStoreIdAndIndexId(int64 object_store_id,
263 int64 index_id) const; 264 int64 index_id) const;
264 bool ValidateObjectStoreIdAndOptionalIndexId(int64 object_store_id, 265 bool ValidateObjectStoreIdAndOptionalIndexId(int64 object_store_id,
265 int64 index_id) const; 266 int64 index_id) const;
266 bool ValidateObjectStoreIdAndNewIndexId(int64 object_store_id, 267 bool ValidateObjectStoreIdAndNewIndexId(int64 object_store_id,
267 int64 index_id) const; 268 int64 index_id) const;
268 269
269 scoped_refptr<IndexedDBBackingStore> backing_store_; 270 scoped_refptr<IndexedDBBackingStore> backing_store_;
270 IndexedDBDatabaseMetadata metadata_; 271 IndexedDBDatabaseMetadata metadata_;
271 272
272 const Identifier identifier_; 273 const Identifier identifier_;
273 // This might not need to be a scoped_refptr since the factory's lifetime is
274 // that of the page group, but it's better to be conservitive than sorry.
275 scoped_refptr<IndexedDBFactory> factory_; 274 scoped_refptr<IndexedDBFactory> factory_;
276 275
277 IndexedDBTransactionCoordinator transaction_coordinator_; 276 IndexedDBTransactionCoordinator transaction_coordinator_;
278 277
279 typedef std::map<int64, IndexedDBTransaction*> TransactionMap; 278 typedef std::map<int64, IndexedDBTransaction*> TransactionMap;
280 TransactionMap transactions_; 279 TransactionMap transactions_;
281 280
282 class PendingOpenCall; 281 typedef std::list<IndexedDBPendingConnection> PendingOpenCallList;
283 typedef std::list<PendingOpenCall*> PendingOpenCallList;
284 PendingOpenCallList pending_open_calls_; 282 PendingOpenCallList pending_open_calls_;
285 283
286 class PendingUpgradeCall; 284 class PendingUpgradeCall;
287 scoped_ptr<PendingUpgradeCall> pending_run_version_change_transaction_call_; 285 scoped_ptr<PendingUpgradeCall> pending_run_version_change_transaction_call_;
288 class PendingSuccessCall; 286 class PendingSuccessCall;
289 scoped_ptr<PendingSuccessCall> pending_second_half_open_; 287 scoped_ptr<PendingSuccessCall> pending_second_half_open_;
290 288
291 class PendingDeleteCall; 289 class PendingDeleteCall;
292 typedef std::list<PendingDeleteCall*> PendingDeleteCallList; 290 typedef std::list<PendingDeleteCall*> PendingDeleteCallList;
293 PendingDeleteCallList pending_delete_calls_; 291 PendingDeleteCallList pending_delete_calls_;
294 292
295 typedef list_set<IndexedDBConnection*> ConnectionSet; 293 typedef list_set<IndexedDBConnection*> ConnectionSet;
296 ConnectionSet connections_; 294 ConnectionSet connections_;
297 }; 295 };
298 296
299 } // namespace content 297 } // namespace content
300 298
301 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ 299 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698