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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void ContextDestroyed(); | 61 void ContextDestroyed(); |
62 | 62 |
63 protected: | 63 protected: |
64 friend class base::RefCounted<IndexedDBFactory>; | 64 friend class base::RefCounted<IndexedDBFactory>; |
65 | 65 |
66 virtual ~IndexedDBFactory(); | 66 virtual ~IndexedDBFactory(); |
67 | 67 |
68 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 68 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
69 const GURL& origin_url, | 69 const GURL& origin_url, |
70 const base::FilePath& data_directory, | 70 const base::FilePath& data_directory, |
71 WebKit::WebIDBCallbacks::DataLoss* data_loss, | 71 blink::WebIDBCallbacks::DataLoss* data_loss, |
72 std::string* data_loss_reason, | 72 std::string* data_loss_reason, |
73 bool* disk_full); | 73 bool* disk_full); |
74 | 74 |
75 void ReleaseBackingStore(const GURL& origin_url, bool immediate); | 75 void ReleaseBackingStore(const GURL& origin_url, bool immediate); |
76 void CloseBackingStore(const GURL& origin_url); | 76 void CloseBackingStore(const GURL& origin_url); |
77 | 77 |
78 private: | 78 private: |
79 // Called internally after a database is closed, with some delay. If this | 79 // Called internally after a database is closed, with some delay. If this |
80 // factory has the last reference, it will be released. | 80 // factory has the last reference, it will be released. |
81 void MaybeCloseBackingStore(const GURL& origin_url); | 81 void MaybeCloseBackingStore(const GURL& origin_url); |
82 bool HasLastBackingStoreReference(const GURL& origin_url) const; | 82 bool HasLastBackingStoreReference(const GURL& origin_url) const; |
83 | 83 |
84 IndexedDBContextImpl* context_; | 84 IndexedDBContextImpl* context_; |
85 | 85 |
86 typedef std::map<IndexedDBDatabase::Identifier, | 86 typedef std::map<IndexedDBDatabase::Identifier, |
87 scoped_refptr<IndexedDBDatabase> > IndexedDBDatabaseMap; | 87 scoped_refptr<IndexedDBDatabase> > IndexedDBDatabaseMap; |
88 IndexedDBDatabaseMap database_map_; | 88 IndexedDBDatabaseMap database_map_; |
89 | 89 |
90 typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> > | 90 typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> > |
91 IndexedDBBackingStoreMap; | 91 IndexedDBBackingStoreMap; |
92 IndexedDBBackingStoreMap backing_store_map_; | 92 IndexedDBBackingStoreMap backing_store_map_; |
93 | 93 |
94 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; | 94 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
98 | 98 |
99 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 99 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
OLD | NEW |