summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/appcache')
-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() {