Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: webkit/quota/quota_task.cc

Issue 10832407: Quota double-delete fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread checker Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/quota/quota_task.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/quota_task.cc
diff --git a/webkit/quota/quota_task.cc b/webkit/quota/quota_task.cc
index 27542d77da8b4179024cb56f611a7823454b3938..728b999ea597a6d31f6f440054c172fa5348e5f6 100644
--- a/webkit/quota/quota_task.cc
+++ b/webkit/quota/quota_task.cc
@@ -30,7 +30,8 @@ void QuotaTask::Start() {
QuotaTask::QuotaTask(QuotaTaskObserver* observer)
: observer_(observer),
- original_task_runner_(base::MessageLoopProxy::current()) {
+ original_task_runner_(base::MessageLoopProxy::current()),
+ delete_scheduled_(false) {
}
void QuotaTask::CallCompleted() {
@@ -48,6 +49,10 @@ void QuotaTask::Abort() {
}
void QuotaTask::DeleteSoon() {
+ DCHECK(original_task_runner_->BelongsToCurrentThread());
+ if (delete_scheduled_)
+ return;
+ delete_scheduled_ = true;
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
« no previous file with comments | « webkit/quota/quota_task.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698