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

Unified Diff: content/browser/indexed_db/indexed_db_factory.h

Issue 93873017: IndexedDBFactory now ForceCloses databases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added multimap for more efficient origin->db mapping. Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_factory.h
diff --git a/content/browser/indexed_db/indexed_db_factory.h b/content/browser/indexed_db/indexed_db_factory.h
index ae0d9364f3bc5a08206428031f5025ea6f2bce4b..4c3fd2ef14b110a2ddcea3ece37af28dcb1b51ea 100644
--- a/content/browser/indexed_db/indexed_db_factory.h
+++ b/content/browser/indexed_db/indexed_db_factory.h
@@ -50,9 +50,10 @@ class CONTENT_EXPORT IndexedDBFactory
void HandleBackingStoreFailure(const GURL& origin_url);
- // Iterates over all databases; for diagnostics only.
- std::vector<IndexedDBDatabase*> GetOpenDatabasesForOrigin(
- const GURL& origin_url) const;
+ typedef std::multimap<GURL, IndexedDBDatabase*> OriginDbMap;
jsbell 2014/01/03 00:34:25 Nit: capitalize 'DB' or spell it out (i.e. 'Databa
cmumford 2014/01/03 21:34:01 Done.
+ typedef OriginDbMap::const_iterator OriginDbMapIterator;
+ std::pair<OriginDbMapIterator, OriginDbMapIterator>
+ GetOpenDatabasesForOrigin(const GURL& origin_url) const;
// Called by IndexedDBContext after all connections are closed, to
// ensure the backing store closed immediately.
@@ -64,6 +65,8 @@ class CONTENT_EXPORT IndexedDBFactory
// Called by an IndexedDBDatabase when it is actually deleted.
void DatabaseDeleted(const IndexedDBDatabase::Identifier& identifier);
+ size_t GetConnectionCount(const GURL& origin_url) const;
+
protected:
friend class base::RefCountedThreadSafe<IndexedDBFactory>;
@@ -104,12 +107,14 @@ class CONTENT_EXPORT IndexedDBFactory
const base::string16& name) const;
bool IsBackingStoreOpen(const GURL& origin_url) const;
bool IsBackingStorePendingClose(const GURL& origin_url) const;
+ void RemoveDatabaseFromMaps(const IndexedDBDatabase::Identifier& identifier);
IndexedDBContextImpl* context_;
typedef std::map<IndexedDBDatabase::Identifier,
IndexedDBDatabase*> IndexedDBDatabaseMap;
IndexedDBDatabaseMap database_map_;
+ OriginDbMap origin_dbs_;
typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> >
IndexedDBBackingStoreMap;

Powered by Google App Engine
This is Rietveld 408576698