summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-19 01:33:34 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-19 01:33:34 +0000
commit4a05eff4d6aa1585bccea16759f2868e3541d326 (patch)
tree18e9b7bda637fdbca670a235dee2cb930dd6b1e8 /content
parent773fe32ba2023a911d0d99a4520612ab45e7a8aa (diff)
downloadchromium_src-4a05eff4d6aa1585bccea16759f2868e3541d326.zip
chromium_src-4a05eff4d6aa1585bccea16759f2868e3541d326.tar.gz
chromium_src-4a05eff4d6aa1585bccea16759f2868e3541d326.tar.bz2
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
Diffstat (limited to 'content')
-rw-r--r--content/browser/indexed_db/indexed_db_factory.cc2
-rw-r--r--content/browser/indexed_db/indexed_db_factory.h2
2 files changed, 2 insertions, 2 deletions
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<IndexedDBDatabase*> 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<IndexedDBDatabase::Identifier,
- scoped_refptr<IndexedDBDatabase> > IndexedDBDatabaseMap;
+ IndexedDBDatabase*> IndexedDBDatabaseMap;
IndexedDBDatabaseMap database_map_;
typedef std::map<GURL, scoped_refptr<IndexedDBBackingStore> >