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 23 matching lines...) Expand all Loading... |
34 typedef std::multimap<GURL, IndexedDBDatabase*> OriginDBMap; | 34 typedef std::multimap<GURL, IndexedDBDatabase*> OriginDBMap; |
35 typedef OriginDBMap::const_iterator OriginDBMapIterator; | 35 typedef OriginDBMap::const_iterator OriginDBMapIterator; |
36 | 36 |
37 explicit IndexedDBFactory(IndexedDBContextImpl* context); | 37 explicit IndexedDBFactory(IndexedDBContextImpl* context); |
38 | 38 |
39 void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, | 39 void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, |
40 bool forcedClose); | 40 bool forcedClose); |
41 | 41 |
42 void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, | 42 void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, |
43 const GURL& origin_url, | 43 const GURL& origin_url, |
44 const base::FilePath& data_directory); | 44 const base::FilePath& data_directory, |
| 45 net::URLRequestContext* request_context); |
45 void Open(const base::string16& name, | 46 void Open(const base::string16& name, |
46 const IndexedDBPendingConnection& connection, | 47 const IndexedDBPendingConnection& connection, |
47 net::URLRequestContext* request_context, | 48 net::URLRequestContext* request_context, |
48 const GURL& origin_url, | 49 const GURL& origin_url, |
49 const base::FilePath& data_directory); | 50 const base::FilePath& data_directory); |
50 | 51 |
51 void DeleteDatabase(const base::string16& name, | 52 void DeleteDatabase(const base::string16& name, |
52 net::URLRequestContext* request_context, | 53 net::URLRequestContext* request_context, |
53 scoped_refptr<IndexedDBCallbacks> callbacks, | 54 scoped_refptr<IndexedDBCallbacks> callbacks, |
54 const GURL& origin_url, | 55 const GURL& origin_url, |
(...skipping 26 matching lines...) Expand all Loading... |
81 virtual ~IndexedDBFactory(); | 82 virtual ~IndexedDBFactory(); |
82 | 83 |
83 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 84 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
84 const GURL& origin_url, | 85 const GURL& origin_url, |
85 const base::FilePath& data_directory, | 86 const base::FilePath& data_directory, |
86 net::URLRequestContext* request_context, | 87 net::URLRequestContext* request_context, |
87 blink::WebIDBDataLoss* data_loss, | 88 blink::WebIDBDataLoss* data_loss, |
88 std::string* data_loss_reason, | 89 std::string* data_loss_reason, |
89 bool* disk_full); | 90 bool* disk_full); |
90 | 91 |
| 92 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( |
| 93 const GURL& origin_url, |
| 94 const base::FilePath& data_directory, |
| 95 net::URLRequestContext* request_context, |
| 96 blink::WebIDBDataLoss* data_loss, |
| 97 std::string* data_loss_message, |
| 98 bool* disk_full, |
| 99 bool first_time); |
| 100 |
91 void ReleaseBackingStore(const GURL& origin_url, bool immediate); | 101 void ReleaseBackingStore(const GURL& origin_url, bool immediate); |
92 void CloseBackingStore(const GURL& origin_url); | 102 void CloseBackingStore(const GURL& origin_url); |
93 IndexedDBContextImpl* context() const { return context_; } | 103 IndexedDBContextImpl* context() const { return context_; } |
94 | 104 |
95 private: | 105 private: |
96 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, | 106 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, |
97 BackingStoreReleasedOnForcedClose); | 107 BackingStoreReleasedOnForcedClose); |
98 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, | 108 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, |
99 BackingStoreReleaseDelayedOnClose); | 109 BackingStoreReleaseDelayedOnClose); |
100 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, DatabaseFailedOpen); | 110 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, DatabaseFailedOpen); |
(...skipping 24 matching lines...) Expand all Loading... |
125 IndexedDBDatabase*> IndexedDBDatabaseMap; | 135 IndexedDBDatabase*> IndexedDBDatabaseMap; |
126 IndexedDBDatabaseMap database_map_; | 136 IndexedDBDatabaseMap database_map_; |
127 OriginDBMap origin_dbs_; | 137 OriginDBMap origin_dbs_; |
128 | 138 |
129 typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> > | 139 typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> > |
130 IndexedDBBackingStoreMap; | 140 IndexedDBBackingStoreMap; |
131 IndexedDBBackingStoreMap backing_store_map_; | 141 IndexedDBBackingStoreMap backing_store_map_; |
132 | 142 |
133 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; | 143 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; |
134 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; | 144 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; |
| 145 std::set<GURL> backends_opened_since_boot_; |
135 }; | 146 }; |
136 | 147 |
137 } // namespace content | 148 } // namespace content |
138 | 149 |
139 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 150 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
OLD | NEW |