summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-31 03:48:06 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-31 03:48:06 +0000
commit4d5ff68daac016849fcf0d22bb82f7252075479d (patch)
treeeb536b0ad822595c68c3104d0844b24e6ef6d392 /webkit
parent2d6ab0fcafda07119890c16cf5f369aedd3229f3 (diff)
downloadchromium_src-4d5ff68daac016849fcf0d22bb82f7252075479d.zip
chromium_src-4d5ff68daac016849fcf0d22bb82f7252075479d.tar.gz
chromium_src-4d5ff68daac016849fcf0d22bb82f7252075479d.tar.bz2
Fix for a crash when there is no DB thread (as is the case in some tests).
BUG=none TEST=manual TBR=ananta Review URL: http://codereview.chromium.org/515075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/appcache/appcache_storage_impl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index d3763db..579a6bf 100644
--- a/webkit/appcache/appcache_storage_impl.cc
+++ b/webkit/appcache/appcache_storage_impl.cc
@@ -70,9 +70,12 @@ class AppCacheStorageImpl::DatabaseTask
void AppCacheStorageImpl::DatabaseTask::Schedule() {
DCHECK(storage_);
DCHECK(AppCacheThread::CurrentlyOn(AppCacheThread::io()));
- storage_->scheduled_database_tasks_.push_back(this);
- AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE,
- NewRunnableMethod(this, &DatabaseTask::CallRun));
+ if (AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE,
+ NewRunnableMethod(this, &DatabaseTask::CallRun))) {
+ storage_->scheduled_database_tasks_.push_back(this);
+ } else {
+ NOTREACHED() << "The database thread is not running.";
+ }
}
void AppCacheStorageImpl::DatabaseTask::CancelCompletion() {