From 4a05eff4d6aa1585bccea16759f2868e3541d326 Mon Sep 17 00:00:00 2001 From: "jsbell@chromium.org" Date: Thu, 19 Dec 2013 01:33:34 +0000 Subject: IndexedDB: Simplify factory->database relationship The IndexedDBFactory -> IndexedDBDatabase relationship is effectively a weak map; keys are a tuple of origin and name, and the lifetime of the database is controlled by connection objects. The database notifies the factory when its connection count dropped to zero so the factory can remove it from the map. The factory was holding a refpointer to the database for no good reason here. Make it a raw pointer, matching other weak map patterns. This change is trivial, but it required several recent patches to make it so - there were hidden assumptions and broken accounting elsewhere. R=dgrogan@chromium.org Review URL: https://codereview.chromium.org/108133004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241744 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/indexed_db/indexed_db_factory.cc | 2 +- content/browser/indexed_db/indexed_db_factory.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc index 1a83332..fb46b8f 100644 --- a/content/browser/indexed_db/indexed_db_factory.cc +++ b/content/browser/indexed_db/indexed_db_factory.cc @@ -334,7 +334,7 @@ std::vector IndexedDBFactory::GetOpenDatabasesForOrigin( it != database_map_.end(); ++it) { if (it->first.first == origin_url) - result.push_back(it->second.get()); + result.push_back(it->second); } return result; } diff --git a/content/browser/indexed_db/indexed_db_factory.h b/content/browser/indexed_db/indexed_db_factory.h index 502f22b..ae0d936 100644 --- a/content/browser/indexed_db/indexed_db_factory.h +++ b/content/browser/indexed_db/indexed_db_factory.h @@ -108,7 +108,7 @@ class CONTENT_EXPORT IndexedDBFactory IndexedDBContextImpl* context_; typedef std::map > IndexedDBDatabaseMap; + IndexedDBDatabase*> IndexedDBDatabaseMap; IndexedDBDatabaseMap database_map_; typedef std::map > -- cgit v1.1