summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorpranay.kumar <pranay.kumar@samsung.com>2015-04-29 20:42:53 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 03:43:30 +0000
commit127a5db6cccb2bc655940a91ecd3ec500703b255 (patch)
treeb3535f9eeeb39019e6b479f4b8c2b38d18f2ba0a /storage
parentf073e7707caec577ad43b4c9e0b1c5c5437a51c9 (diff)
downloadchromium_src-127a5db6cccb2bc655940a91ecd3ec500703b255.zip
chromium_src-127a5db6cccb2bc655940a91ecd3ec500703b255.tar.gz
chromium_src-127a5db6cccb2bc655940a91ecd3ec500703b255.tar.bz2
Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in storage/browser/fileapi module.
MessageLoopProxy is deprecated. This basically does a search and replace of: MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get(). MessageLoopProxy -> SingleThreadTaskRunner BUG=391045 Review URL: https://codereview.chromium.org/1115663002 Cr-Commit-Position: refs/heads/master@{#327648}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/fileapi/file_system_context.cc7
-rw-r--r--storage/browser/fileapi/file_system_operation_runner.cc16
-rw-r--r--storage/browser/fileapi/isolated_file_system_backend.cc4
-rw-r--r--storage/browser/fileapi/plugin_private_file_system_backend.cc5
-rw-r--r--storage/browser/fileapi/recursive_operation_delegate.cc8
5 files changed, 22 insertions, 18 deletions
diff --git a/storage/browser/fileapi/file_system_context.cc b/storage/browser/fileapi/file_system_context.cc
index defccc8..5d28b00 100644
--- a/storage/browser/fileapi/file_system_context.cc
+++ b/storage/browser/fileapi/file_system_context.cc
@@ -8,6 +8,7 @@
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/task_runner_util.h"
+#include "base/thread_task_runner_handle.h"
#include "net/url_request/url_request.h"
#include "storage/browser/fileapi/copy_or_move_file_validator.h"
#include "storage/browser/fileapi/external_mount_points.h"
@@ -66,13 +67,13 @@ void DidGetMetadataForResolveURL(
}
void RelayResolveURLCallback(
- scoped_refptr<base::MessageLoopProxy> message_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const FileSystemContext::ResolveURLCallback& callback,
base::File::Error result,
const FileSystemInfo& info,
const base::FilePath& file_path,
FileSystemContext::ResolvedEntryType type) {
- message_loop->PostTask(
+ task_runner->PostTask(
FROM_HERE, base::Bind(callback, result, info, file_path, type));
}
@@ -365,7 +366,7 @@ void FileSystemContext::ResolveURL(
if (!io_task_runner_->RunsTasksOnCurrentThread()) {
ResolveURLCallback relay_callback =
base::Bind(&RelayResolveURLCallback,
- base::MessageLoopProxy::current(), callback);
+ base::ThreadTaskRunnerHandle::Get(), callback);
io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&FileSystemContext::ResolveURL, this, url, relay_callback));
diff --git a/storage/browser/fileapi/file_system_operation_runner.cc b/storage/browser/fileapi/file_system_operation_runner.cc
index 848929f..a53f588 100644
--- a/storage/browser/fileapi/file_system_operation_runner.cc
+++ b/storage/browser/fileapi/file_system_operation_runner.cc
@@ -5,8 +5,8 @@
#include "storage/browser/fileapi/file_system_operation_runner.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/stl_util.h"
+#include "base/thread_task_runner_handle.h"
#include "net/url_request/url_request_context.h"
#include "storage/browser/blob/blob_url_request_job_factory.h"
#include "storage/browser/blob/shareable_file_reference.h"
@@ -514,7 +514,7 @@ void FileSystemOperationRunner::DidFinish(
base::File::Error rv) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidFinish,
AsWeakPtr(), handle, callback, rv));
return;
@@ -530,7 +530,7 @@ void FileSystemOperationRunner::DidGetMetadata(
const base::File::Info& file_info) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidGetMetadata,
AsWeakPtr(), handle, callback, rv, file_info));
return;
@@ -547,7 +547,7 @@ void FileSystemOperationRunner::DidReadDirectory(
bool has_more) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidReadDirectory,
AsWeakPtr(), handle, callback, rv,
entries, has_more));
@@ -566,7 +566,7 @@ void FileSystemOperationRunner::DidWrite(
bool complete) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidWrite, AsWeakPtr(),
handle, callback, rv, bytes, complete));
return;
@@ -583,7 +583,7 @@ void FileSystemOperationRunner::DidOpenFile(
const base::Closure& on_close_callback) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidOpenFile,
AsWeakPtr(), handle, callback, Passed(&file),
on_close_callback));
@@ -602,7 +602,7 @@ void FileSystemOperationRunner::DidCreateSnapshot(
const scoped_refptr<storage::ShareableFileReference>& file_ref) {
if (handle.scope) {
finished_operations_.insert(handle.id);
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FileSystemOperationRunner::DidCreateSnapshot,
AsWeakPtr(), handle, callback, rv, file_info,
platform_path, file_ref));
@@ -620,7 +620,7 @@ void FileSystemOperationRunner::OnCopyProgress(
const FileSystemURL& dest_url,
int64 size) {
if (handle.scope) {
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(
&FileSystemOperationRunner::OnCopyProgress,
AsWeakPtr(), handle, callback, type, source_url, dest_url, size));
diff --git a/storage/browser/fileapi/isolated_file_system_backend.cc b/storage/browser/fileapi/isolated_file_system_backend.cc
index 0c8da67..6ecc9e2 100644
--- a/storage/browser/fileapi/isolated_file_system_backend.cc
+++ b/storage/browser/fileapi/isolated_file_system_backend.cc
@@ -10,8 +10,8 @@
#include "base/files/file_path.h"
#include "base/files/file_util_proxy.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/sequenced_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "storage/browser/fileapi/async_file_util_adapter.h"
#include "storage/browser/fileapi/copy_or_move_file_validator.h"
#include "storage/browser/fileapi/dragged_file_util.h"
@@ -65,7 +65,7 @@ void IsolatedFileSystemBackend::ResolveURL(
OpenFileSystemMode mode,
const OpenFileSystemCallback& callback) {
// We never allow opening a new isolated FileSystem via usual ResolveURL.
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(callback,
GURL(),
diff --git a/storage/browser/fileapi/plugin_private_file_system_backend.cc b/storage/browser/fileapi/plugin_private_file_system_backend.cc
index 72a0cd9..153062b 100644
--- a/storage/browser/fileapi/plugin_private_file_system_backend.cc
+++ b/storage/browser/fileapi/plugin_private_file_system_backend.cc
@@ -9,6 +9,7 @@
#include "base/stl_util.h"
#include "base/synchronization/lock.h"
#include "base/task_runner_util.h"
+#include "base/thread_task_runner_handle.h"
#include "net/base/net_util.h"
#include "storage/browser/fileapi/async_file_util_adapter.h"
#include "storage/browser/fileapi/file_stream_reader.h"
@@ -122,7 +123,7 @@ void PluginPrivateFileSystemBackend::OpenPrivateFileSystem(
OpenFileSystemMode mode,
const StatusCallback& callback) {
if (!CanHandleType(type) || file_system_options_.is_incognito()) {
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, base::File::FILE_ERROR_SECURITY));
return;
}
@@ -149,7 +150,7 @@ void PluginPrivateFileSystemBackend::ResolveURL(
const OpenFileSystemCallback& callback) {
// We never allow opening a new plugin-private filesystem via usual
// ResolveURL.
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(callback, GURL(), std::string(),
base::File::FILE_ERROR_SECURITY));
diff --git a/storage/browser/fileapi/recursive_operation_delegate.cc b/storage/browser/fileapi/recursive_operation_delegate.cc
index e9d1466..609df31 100644
--- a/storage/browser/fileapi/recursive_operation_delegate.cc
+++ b/storage/browser/fileapi/recursive_operation_delegate.cc
@@ -5,6 +5,8 @@
#include "storage/browser/fileapi/recursive_operation_delegate.h"
#include "base/bind.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "storage/browser/fileapi/file_system_context.h"
#include "storage/browser/fileapi/file_system_operation_runner.h"
@@ -150,12 +152,12 @@ void RecursiveOperationDelegate::ProcessPendingFiles() {
return;
// Run ProcessFile in parallel (upto kMaxInflightOperations).
- scoped_refptr<base::MessageLoopProxy> current_message_loop =
- base::MessageLoopProxy::current();
+ scoped_refptr<base::SingleThreadTaskRunner> current_task_runner =
+ base::ThreadTaskRunnerHandle::Get();
while (!pending_files_.empty() &&
inflight_operations_ < kMaxInflightOperations) {
++inflight_operations_;
- current_message_loop->PostTask(
+ current_task_runner->PostTask(
FROM_HERE,
base::Bind(&RecursiveOperationDelegate::ProcessFile,
AsWeakPtr(), pending_files_.front(),