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

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

Issue 259063004: Track which IndexedDBBackingStores have been opened since boot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged out Created 6 years, 7 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_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
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
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
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_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_dispatcher_host.cc ('k') | content/browser/indexed_db/indexed_db_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698