Index: webkit/fileapi/file_system_quota_util.cc |
diff --git a/webkit/fileapi/file_system_quota_util.cc b/webkit/fileapi/file_system_quota_util.cc |
index 9a5a63cf261034f2e8d2e4d1447e36e814afe5ed..286588d630c28a00a210a4cf979b93c1f3c26c75 100644 |
--- a/webkit/fileapi/file_system_quota_util.cc |
+++ b/webkit/fileapi/file_system_quota_util.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,14 +8,15 @@ |
#include "base/compiler_specific.h" |
#include "base/location.h" |
#include "base/message_loop_proxy.h" |
+#include "base/sequenced_task_runner.h" |
namespace fileapi { |
void FileSystemQuotaUtil::Proxy::UpdateOriginUsage( |
quota::QuotaManagerProxy* proxy, const GURL& origin_url, |
fileapi::FileSystemType type, int64 delta) { |
- if (!file_thread_->BelongsToCurrentThread()) { |
- file_thread_->PostTask( |
+ if (!file_task_runner_->RunsTasksOnCurrentThread()) { |
+ file_task_runner_->PostTask( |
FROM_HERE, |
base::Bind(&Proxy::UpdateOriginUsage, this, proxy, origin_url, type, |
delta)); |
@@ -27,8 +28,8 @@ void FileSystemQuotaUtil::Proxy::UpdateOriginUsage( |
void FileSystemQuotaUtil::Proxy::StartUpdateOrigin( |
const GURL& origin_url, fileapi::FileSystemType type) { |
- if (!file_thread_->BelongsToCurrentThread()) { |
- file_thread_->PostTask( |
+ if (!file_task_runner_->RunsTasksOnCurrentThread()) { |
+ file_task_runner_->PostTask( |
FROM_HERE, |
base::Bind(&Proxy::StartUpdateOrigin, this, origin_url, type)); |
return; |
@@ -39,8 +40,8 @@ void FileSystemQuotaUtil::Proxy::StartUpdateOrigin( |
void FileSystemQuotaUtil::Proxy::EndUpdateOrigin( |
const GURL& origin_url, fileapi::FileSystemType type) { |
- if (!file_thread_->BelongsToCurrentThread()) { |
- file_thread_->PostTask( |
+ if (!file_task_runner_->RunsTasksOnCurrentThread()) { |
+ file_task_runner_->PostTask( |
FROM_HERE, |
base::Bind(&Proxy::EndUpdateOrigin, this, origin_url, type)); |
return; |
@@ -51,17 +52,19 @@ void FileSystemQuotaUtil::Proxy::EndUpdateOrigin( |
FileSystemQuotaUtil::Proxy::Proxy( |
FileSystemQuotaUtil* quota_util, |
- base::MessageLoopProxy* file_thread) |
+ base::SequencedTaskRunner* file_task_runner) |
: quota_util_(quota_util), |
- file_thread_(file_thread) { |
+ file_task_runner_(file_task_runner) { |
DCHECK(quota_util); |
} |
FileSystemQuotaUtil::Proxy::~Proxy() { |
} |
-FileSystemQuotaUtil::FileSystemQuotaUtil(base::MessageLoopProxy* file_thread) |
- : proxy_(new Proxy(ALLOW_THIS_IN_INITIALIZER_LIST(this), file_thread)) { |
+FileSystemQuotaUtil::FileSystemQuotaUtil( |
+ base::SequencedTaskRunner* file_task_runner) |
+ : proxy_(new Proxy(ALLOW_THIS_IN_INITIALIZER_LIST(this), |
+ file_task_runner)) { |
} |
FileSystemQuotaUtil::~FileSystemQuotaUtil() { |