summaryrefslogtreecommitdiffstats
path: root/content/browser/indexed_db/indexed_db_unittest.cc
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 22:24:46 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 22:24:46 +0000
commit1c0f122770b70c32c4f717134cc94b3dafed2012 (patch)
tree4a33abd3b59ca3ce58e92beb7c44ebb89dd4cb7a /content/browser/indexed_db/indexed_db_unittest.cc
parent64766d7f183fe39fabfb2c8190d127e4ea6bcf58 (diff)
downloadchromium_src-1c0f122770b70c32c4f717134cc94b3dafed2012.zip
chromium_src-1c0f122770b70c32c4f717134cc94b3dafed2012.tar.gz
chromium_src-1c0f122770b70c32c4f717134cc94b3dafed2012.tar.bz2
IndexedDB: Ensure that closed connections are not used
Once a database connection object is closed it doesn't need to hold a database reference. This can be used to detect the case where a request arrives from a renderer after a connection is forcibly closed by the back end, and drop the request. In most cases the request would be associated with a transaction that would have been aborted/removed from the database's list and hence the request would just be dropped. The CreateTransaction() and Close() requests aren't, so they need this check. In the other cases this will just exit earlier and let the database object be released. BUG=308699 Review URL: https://codereview.chromium.org/26454005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229627 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/indexed_db/indexed_db_unittest.cc')
-rw-r--r--content/browser/indexed_db/indexed_db_unittest.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc
index 3ec6bea..0467c1c 100644
--- a/content/browser/indexed_db/indexed_db_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_unittest.cc
@@ -128,6 +128,10 @@ class MockConnection : public IndexedDBConnection {
force_close_called_ = true;
}
+ virtual bool IsConnected() OVERRIDE {
+ return !force_close_called_;
+ }
+
private:
bool expect_force_close_;
bool force_close_called_;