summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 00:08:01 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 00:08:01 +0000
commitcc7cde43832b547cdab856fe1bedc9514ca38e13 (patch)
tree450816c01740c529ec3a9d4391e8f85230066a35 /content
parent44d62b66db9684253afebe2cd081a4353f0e4fa8 (diff)
downloadchromium_src-cc7cde43832b547cdab856fe1bedc9514ca38e13.zip
chromium_src-cc7cde43832b547cdab856fe1bedc9514ca38e13.tar.gz
chromium_src-cc7cde43832b547cdab856fe1bedc9514ca38e13.tar.bz2
Add DCHECK to ensure IndexedDBDispatcher doesn't get re-created.
This could happen if there are IDB objects that survive the call to didStopWorkerRunLoop. BUG=121734 TEST= Review URL: http://codereview.chromium.org/9999035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/indexed_db/indexed_db_dispatcher.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc
index b778ca2..ece670d 100644
--- a/content/common/indexed_db/indexed_db_dispatcher.cc
+++ b/content/common/indexed_db/indexed_db_dispatcher.cc
@@ -38,6 +38,9 @@ static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher> >::Leaky
namespace {
+IndexedDBDispatcher* const HAS_BEEN_DELETED =
+ reinterpret_cast<IndexedDBDispatcher*>(0x1);
+
int32 CurrentWorkerId() {
return WorkerTaskRunner::Instance()->CurrentWorkerId();
}
@@ -51,10 +54,14 @@ IndexedDBDispatcher::IndexedDBDispatcher() {
}
IndexedDBDispatcher::~IndexedDBDispatcher() {
- g_idb_dispatcher_tls.Pointer()->Set(NULL);
+ g_idb_dispatcher_tls.Pointer()->Set(HAS_BEEN_DELETED);
}
IndexedDBDispatcher* IndexedDBDispatcher::ThreadSpecificInstance() {
+ if (g_idb_dispatcher_tls.Pointer()->Get() == HAS_BEEN_DELETED) {
+ NOTREACHED() << "Re-instantiating TLS IndexedDBDispatcher.";
+ g_idb_dispatcher_tls.Pointer()->Set(NULL);
+ }
if (g_idb_dispatcher_tls.Pointer()->Get())
return g_idb_dispatcher_tls.Pointer()->Get();