| OLD | NEW |
| 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_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBFactory>) { | 27 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBFactory>) { |
| 28 public: | 28 public: |
| 29 static scoped_refptr<IndexedDBFactory> Create() { | 29 static scoped_refptr<IndexedDBFactory> Create() { |
| 30 return make_scoped_refptr(new IndexedDBFactory()); | 30 return make_scoped_refptr(new IndexedDBFactory()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Notifications from weak pointers. | 33 // Notifications from weak pointers. |
| 34 void RemoveIDBDatabaseBackend(const string16& unique_identifier); | 34 void RemoveIDBDatabaseBackend(const string16& unique_identifier); |
| 35 | 35 |
| 36 void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, | 36 void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, |
| 37 const string16& database_identifier, | 37 const std::string& origin_identifier, |
| 38 const base::FilePath& data_directory); | 38 const base::FilePath& data_directory); |
| 39 void Open(const string16& name, | 39 void Open(const string16& name, |
| 40 int64 version, | 40 int64 version, |
| 41 int64 transaction_id, | 41 int64 transaction_id, |
| 42 scoped_refptr<IndexedDBCallbacks> callbacks, | 42 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 43 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, | 43 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, |
| 44 const string16& database_identifier, | 44 const std::string& origin_identifier, |
| 45 const base::FilePath& data_directory); | 45 const base::FilePath& data_directory); |
| 46 | 46 |
| 47 void DeleteDatabase(const string16& name, | 47 void DeleteDatabase(const string16& name, |
| 48 scoped_refptr<IndexedDBCallbacks> callbacks, | 48 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 49 const string16& database_identifier, | 49 const std::string& origin_identifier, |
| 50 const base::FilePath& data_directory); | 50 const base::FilePath& data_directory); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 friend class base::RefCounted<IndexedDBFactory>; | 53 friend class base::RefCounted<IndexedDBFactory>; |
| 54 | 54 |
| 55 IndexedDBFactory(); | 55 IndexedDBFactory(); |
| 56 virtual ~IndexedDBFactory(); | 56 virtual ~IndexedDBFactory(); |
| 57 | 57 |
| 58 scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 58 scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
| 59 const string16& database_identifier, | 59 const std::string& origin_identifier, |
| 60 const base::FilePath& data_directory, | 60 const base::FilePath& data_directory, |
| 61 WebKit::WebIDBCallbacks::DataLoss* data_loss); | 61 WebKit::WebIDBCallbacks::DataLoss* data_loss); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 typedef std::map<string16, scoped_refptr<IndexedDBDatabase> > | 64 typedef std::map<string16, scoped_refptr<IndexedDBDatabase> > |
| 65 IndexedDBDatabaseMap; | 65 IndexedDBDatabaseMap; |
| 66 IndexedDBDatabaseMap database_backend_map_; | 66 IndexedDBDatabaseMap database_backend_map_; |
| 67 | 67 |
| 68 typedef std::map<string16, base::WeakPtr<IndexedDBBackingStore> > | 68 typedef std::map<std::string, base::WeakPtr<IndexedDBBackingStore> > |
| 69 IndexedDBBackingStoreMap; | 69 IndexedDBBackingStoreMap; |
| 70 IndexedDBBackingStoreMap backing_store_map_; | 70 IndexedDBBackingStoreMap backing_store_map_; |
| 71 | 71 |
| 72 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; | 72 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace content | 75 } // namespace content |
| 76 | 76 |
| 77 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 77 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
| OLD | NEW |