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

Unified Diff: webkit/fileapi/file_system_quota_util.cc

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 8 years, 7 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/fileapi/file_system_quota_util.h ('k') | webkit/fileapi/file_system_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « webkit/fileapi/file_system_quota_util.h ('k') | webkit/fileapi/file_system_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698