Chromium Code Reviews| Index: webkit/quota/quota_task.cc |
| diff --git a/webkit/quota/quota_task.cc b/webkit/quota/quota_task.cc |
| index 28d275f516ee0bd18ce21ec298a57e0a89ba1e76..dab5d415e90d651830153c7de54fe9ef3f04e27f 100644 |
| --- a/webkit/quota/quota_task.cc |
| +++ b/webkit/quota/quota_task.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -8,10 +8,11 @@ |
| #include <functional> |
| #include "base/bind.h" |
| -#include "base/message_loop.h" |
| +#include "base/location.h" |
| #include "base/message_loop_proxy.h" |
| +#include "base/single_thread_task_runner.h" |
| -using base::MessageLoopProxy; |
| +using base::TaskRunner; |
| namespace quota { |
| @@ -28,11 +29,11 @@ void QuotaTask::Start() { |
| QuotaTask::QuotaTask(QuotaTaskObserver* observer) |
| : observer_(observer), |
| - original_message_loop_(MessageLoopProxy::current()) { |
| + original_task_runner_(base::MessageLoopProxy::current()) { |
| } |
| void QuotaTask::CallCompleted() { |
| - DCHECK(original_message_loop_->BelongsToCurrentThread()); |
| + DCHECK(original_task_runner_->BelongsToCurrentThread()); |
| if (observer_) { |
| observer_->UnregisterTask(this); |
| Completed(); |
| @@ -40,37 +41,36 @@ void QuotaTask::CallCompleted() { |
| } |
| void QuotaTask::Abort() { |
| - DCHECK(original_message_loop_->BelongsToCurrentThread()); |
| + DCHECK(original_task_runner_->BelongsToCurrentThread()); |
| observer_ = NULL; |
| Aborted(); |
| } |
| void QuotaTask::DeleteSoon() { |
| - MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| + original_task_runner_->DeleteSoon(FROM_HERE, this); |
|
michaeln
2012/04/27 01:04:03
Is it ok to make this change, previously the delet
kinuko
2012/04/27 10:10:29
Reverted this for compatibility reasons.
|
| } |
| // QuotaThreadTask --------------------------------------------------------- |
| QuotaThreadTask::QuotaThreadTask( |
| QuotaTaskObserver* observer, |
| - scoped_refptr<MessageLoopProxy> target_message_loop) |
| + TaskRunner* target_task_runner) |
| : QuotaTask(observer), |
| - target_message_loop_(target_message_loop) { |
| + target_task_runner_(target_task_runner) { |
| } |
| QuotaThreadTask::~QuotaThreadTask() { |
| } |
| void QuotaThreadTask::Run() { |
| - target_message_loop_->PostTask( |
| + target_task_runner_->PostTask( |
| FROM_HERE, |
| base::Bind(&QuotaThreadTask::CallRunOnTargetThread, this)); |
| } |
| void QuotaThreadTask::CallRunOnTargetThread() { |
| - DCHECK(target_message_loop_->BelongsToCurrentThread()); |
| if (RunOnTargetThreadAsync()) |
| - original_message_loop()->PostTask( |
| + original_task_runner()->PostTask( |
| FROM_HERE, |
| base::Bind(&QuotaThreadTask::CallCompleted, this)); |
| } |