diff options
author | pranay.kumar <pranay.kumar@samsung.com> | 2015-05-03 21:12:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-04 04:13:08 +0000 |
commit | 4e254712d7fddbc1e5dbad750dce5aede3dab613 (patch) | |
tree | eac6d99a5d7e4dc5909038b39381e879a7ae2e9a /storage | |
parent | 7e8c04266e04163f62df892180b085b46296a4a1 (diff) | |
download | chromium_src-4e254712d7fddbc1e5dbad750dce5aede3dab613.zip chromium_src-4e254712d7fddbc1e5dbad750dce5aede3dab613.tar.gz chromium_src-4e254712d7fddbc1e5dbad750dce5aede3dab613.tar.bz2 |
Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in complete storage 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/1120553002
Cr-Commit-Position: refs/heads/master@{#328095}
Diffstat (limited to 'storage')
18 files changed, 37 insertions, 47 deletions
diff --git a/storage/browser/blob/blob_storage_context.cc b/storage/browser/blob/blob_storage_context.cc index 45c4f8c..b2d50cd 100644 --- a/storage/browser/blob/blob_storage_context.cc +++ b/storage/browser/blob/blob_storage_context.cc @@ -11,9 +11,9 @@ #include "base/location.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/metrics/histogram.h" #include "base/stl_util.h" +#include "base/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_data_handle.h" @@ -78,7 +78,8 @@ scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( return result.Pass(); DCHECK(!entry->IsBeingBuilt()); result.reset( - new BlobDataHandle(uuid, this, base::MessageLoopProxy::current().get())); + new BlobDataHandle(uuid, this, + base::ThreadTaskRunnerHandle::Get().get())); return result.Pass(); } diff --git a/storage/browser/blob/blob_url_request_job.cc b/storage/browser/blob/blob_url_request_job.cc index d94fa0b..4362706 100644 --- a/storage/browser/blob/blob_url_request_job.cc +++ b/storage/browser/blob/blob_url_request_job.cc @@ -15,7 +15,6 @@ #include "base/files/file_util_proxy.h" #include "base/format_macros.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/numerics/safe_conversions.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" @@ -57,11 +56,11 @@ BlobURLRequestJob::BlobURLRequestJob( net::NetworkDelegate* network_delegate, scoped_ptr<BlobDataSnapshot> blob_data, storage::FileSystemContext* file_system_context, - base::MessageLoopProxy* file_thread_proxy) + base::SingleThreadTaskRunner* file_task_runner) : net::URLRequestJob(request, network_delegate), blob_data_(blob_data.Pass()), file_system_context_(file_system_context), - file_thread_proxy_(file_thread_proxy), + file_task_runner_(file_task_runner), total_size_(0), remaining_bytes_(0), pending_get_file_info_count_(0), @@ -72,7 +71,7 @@ BlobURLRequestJob::BlobURLRequestJob( weak_factory_(this) { TRACE_EVENT_ASYNC_BEGIN1("Blob", "BlobRequest", this, "uuid", blob_data_ ? blob_data_->uuid() : "NotFound"); - DCHECK(file_thread_proxy_.get()); + DCHECK(file_task_runner_.get()); } void BlobURLRequestJob::Start() { @@ -596,7 +595,7 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, switch (item.type()) { case DataElement::TYPE_FILE: reader = FileStreamReader::CreateForLocalFile( - file_thread_proxy_.get(), + file_task_runner_.get(), item.path(), item.offset() + additional_offset, item.expected_modification_time()); diff --git a/storage/browser/blob/blob_url_request_job.h b/storage/browser/blob/blob_url_request_job.h index 3dfc093..b9c3040 100644 --- a/storage/browser/blob/blob_url_request_job.h +++ b/storage/browser/blob/blob_url_request_job.h @@ -16,7 +16,7 @@ #include "storage/browser/storage_browser_export.h" namespace base { -class MessageLoopProxy; +class SingleThreadTaskRunner; } namespace storage { @@ -40,7 +40,7 @@ class STORAGE_EXPORT BlobURLRequestJob net::NetworkDelegate* network_delegate, scoped_ptr<BlobDataSnapshot> blob_data, storage::FileSystemContext* file_system_context, - base::MessageLoopProxy* resolving_message_loop_proxy); + base::SingleThreadTaskRunner* resolving_thread_task_runner); // net::URLRequestJob methods. void Start() override; @@ -96,7 +96,7 @@ class STORAGE_EXPORT BlobURLRequestJob // Variables for controlling read from |blob_data_|. scoped_refptr<storage::FileSystemContext> file_system_context_; - scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; + scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; std::vector<int64> item_length_list_; int64 total_size_; int64 remaining_bytes_; diff --git a/storage/browser/blob/blob_url_request_job_factory.cc b/storage/browser/blob/blob_url_request_job_factory.cc index d9514a1..34a0904 100644 --- a/storage/browser/blob/blob_url_request_job_factory.cc +++ b/storage/browser/blob/blob_url_request_job_factory.cc @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/strings/string_util.h" #include "net/base/request_priority.h" #include "net/url_request/url_request_context.h" @@ -50,8 +49,9 @@ void BlobProtocolHandler::SetRequestedBlobDataHandle( BlobProtocolHandler::BlobProtocolHandler( BlobStorageContext* context, storage::FileSystemContext* file_system_context, - const scoped_refptr<base::MessageLoopProxy>& loop_proxy) - : file_system_context_(file_system_context), file_loop_proxy_(loop_proxy) { + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) + : file_system_context_(file_system_context), + file_task_runner_(task_runner) { if (context) context_ = context->AsWeakPtr(); } @@ -65,7 +65,7 @@ net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob( network_delegate, LookupBlobData(request), file_system_context_.get(), - file_loop_proxy_.get()); + file_task_runner_.get()); } scoped_ptr<BlobDataSnapshot> BlobProtocolHandler::LookupBlobData( diff --git a/storage/browser/blob/blob_url_request_job_factory.h b/storage/browser/blob/blob_url_request_job_factory.h index 381a95f..7f7a550 100644 --- a/storage/browser/blob/blob_url_request_job_factory.h +++ b/storage/browser/blob/blob_url_request_job_factory.h @@ -13,7 +13,7 @@ #include "storage/browser/storage_browser_export.h" namespace base { -class MessageLoopProxy; +class SingleThreadTaskRunner; } // namespace base namespace storage { @@ -48,7 +48,7 @@ class STORAGE_EXPORT BlobProtocolHandler BlobProtocolHandler( BlobStorageContext* context, storage::FileSystemContext* file_system_context, - const scoped_refptr<base::MessageLoopProxy>& file_loop_proxy); + const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); ~BlobProtocolHandler() override; net::URLRequestJob* MaybeCreateJob( @@ -60,7 +60,7 @@ class STORAGE_EXPORT BlobProtocolHandler base::WeakPtr<BlobStorageContext> context_; const scoped_refptr<storage::FileSystemContext> file_system_context_; - const scoped_refptr<base::MessageLoopProxy> file_loop_proxy_; + const scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler); }; diff --git a/storage/browser/blob/shareable_file_reference.cc b/storage/browser/blob/shareable_file_reference.cc index 02a5be4..e660239 100644 --- a/storage/browser/blob/shareable_file_reference.cc +++ b/storage/browser/blob/shareable_file_reference.cc @@ -7,7 +7,6 @@ #include <map> #include "base/lazy_instance.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/task_runner.h" #include "base/threading/non_thread_safe.h" diff --git a/storage/browser/database/database_quota_client.cc b/storage/browser/database/database_quota_client.cc index 5119a1c..fd55a6f 100644 --- a/storage/browser/database/database_quota_client.cc +++ b/storage/browser/database/database_quota_client.cc @@ -10,8 +10,8 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/task_runner_util.h" +#include "base/thread_task_runner_handle.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" #include "storage/browser/database/database_tracker.h" @@ -95,7 +95,7 @@ void DidDeleteOriginData( } // namespace DatabaseQuotaClient::DatabaseQuotaClient( - base::MessageLoopProxy* db_tracker_thread, + base::SingleThreadTaskRunner* db_tracker_thread, DatabaseTracker* db_tracker) : db_tracker_thread_(db_tracker_thread), db_tracker_(db_tracker) { } @@ -200,7 +200,7 @@ void DatabaseQuotaClient::DeleteOriginData(const GURL& origin, base::Callback<void(int)> delete_callback = base::Bind(&DidDeleteOriginData, - base::MessageLoopProxy::current(), + base::ThreadTaskRunnerHandle::Get(), callback); PostTaskAndReplyWithResult( diff --git a/storage/browser/database/database_quota_client.h b/storage/browser/database/database_quota_client.h index 4b168c6..8612310 100644 --- a/storage/browser/database/database_quota_client.h +++ b/storage/browser/database/database_quota_client.h @@ -9,7 +9,7 @@ #include <string> #include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" #include "storage/browser/quota/quota_client.h" #include "storage/browser/storage_browser_export.h" #include "storage/common/quota/quota_types.h" @@ -25,7 +25,7 @@ class STORAGE_EXPORT_PRIVATE DatabaseQuotaClient : public storage::QuotaClient { public: DatabaseQuotaClient( - base::MessageLoopProxy* tracker_thread, + base::SingleThreadTaskRunner* tracker_thread, DatabaseTracker* tracker); ~DatabaseQuotaClient() override; @@ -46,7 +46,7 @@ class STORAGE_EXPORT_PRIVATE DatabaseQuotaClient bool DoesSupport(storage::StorageType type) const override; private: - scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; + scoped_refptr<base::SingleThreadTaskRunner> db_tracker_thread_; scoped_refptr<DatabaseTracker> db_tracker_; // only used on its thread DISALLOW_COPY_AND_ASSIGN(DatabaseQuotaClient); diff --git a/storage/browser/database/database_tracker.cc b/storage/browser/database/database_tracker.cc index b7e4623..bceb7c8 100644 --- a/storage/browser/database/database_tracker.cc +++ b/storage/browser/database/database_tracker.cc @@ -12,7 +12,6 @@ #include "base/files/file.h" #include "base/files/file_enumerator.h" #include "base/files/file_util.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "net/base/net_errors.h" @@ -84,7 +83,7 @@ DatabaseTracker::DatabaseTracker( bool is_incognito, storage::SpecialStoragePolicy* special_storage_policy, storage::QuotaManagerProxy* quota_manager_proxy, - base::MessageLoopProxy* db_tracker_thread) + base::SingleThreadTaskRunner* db_tracker_thread) : is_initialized_(false), is_incognito_(is_incognito), force_keep_session_state_(false), diff --git a/storage/browser/database/database_tracker.h b/storage/browser/database/database_tracker.h index f998b4b..e9817a5 100644 --- a/storage/browser/database/database_tracker.h +++ b/storage/browser/database/database_tracker.h @@ -23,7 +23,7 @@ #include "storage/common/database/database_connections.h" namespace base { -class MessageLoopProxy; +class SingleThreadTaskRunner; } namespace content { @@ -105,7 +105,7 @@ class STORAGE_EXPORT DatabaseTracker bool is_incognito, storage::SpecialStoragePolicy* special_storage_policy, storage::QuotaManagerProxy* quota_manager_proxy, - base::MessageLoopProxy* db_tracker_thread); + base::SingleThreadTaskRunner* db_tracker_thread); void DatabaseOpened(const std::string& origin_identifier, const base::string16& database_name, @@ -295,7 +295,7 @@ class STORAGE_EXPORT DatabaseTracker scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; // The database tracker thread we're supposed to run file IO on. - scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; + scoped_refptr<base::SingleThreadTaskRunner> db_tracker_thread_; // When in incognito mode, store a DELETE_ON_CLOSE handle to each // main DB and journal file that was accessed. When the incognito profile diff --git a/storage/browser/fileapi/async_file_util_adapter.cc b/storage/browser/fileapi/async_file_util_adapter.cc index 7d324c0..ed8f84f 100644 --- a/storage/browser/fileapi/async_file_util_adapter.cc +++ b/storage/browser/fileapi/async_file_util_adapter.cc @@ -86,7 +86,7 @@ class GetFileInfoHelper { void ReadDirectoryHelper(FileSystemFileUtil* file_util, FileSystemOperationContext* context, const FileSystemURL& url, - base::SingleThreadTaskRunner* origin_loop, + base::SingleThreadTaskRunner* origin_runner, const AsyncFileUtil::ReadDirectoryCallback& callback) { base::File::Info file_info; base::FilePath platform_path; @@ -98,7 +98,7 @@ void ReadDirectoryHelper(FileSystemFileUtil* file_util, std::vector<DirectoryEntry> entries; if (error != base::File::FILE_OK) { - origin_loop->PostTask( + origin_runner->PostTask( FROM_HERE, base::Bind(callback, error, entries, false /* has_more */)); return; } @@ -121,13 +121,13 @@ void ReadDirectoryHelper(FileSystemFileUtil* file_util, entries.push_back(entry); if (entries.size() == kResultChunkSize) { - origin_loop->PostTask( + origin_runner->PostTask( FROM_HERE, base::Bind(callback, base::File::FILE_OK, entries, true /* has_more */)); entries.clear(); } } - origin_loop->PostTask( + origin_runner->PostTask( FROM_HERE, base::Bind(callback, base::File::FILE_OK, entries, false /* has_more */)); } diff --git a/storage/browser/fileapi/file_system_dir_url_request_job.h b/storage/browser/fileapi/file_system_dir_url_request_job.h index f2567e4..8715c96 100644 --- a/storage/browser/fileapi/file_system_dir_url_request_job.h +++ b/storage/browser/fileapi/file_system_dir_url_request_job.h @@ -11,7 +11,6 @@ #include "base/files/file.h" #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop_proxy.h" #include "net/url_request/url_request_job.h" #include "storage/browser/fileapi/file_system_url.h" #include "storage/browser/storage_browser_export.h" diff --git a/storage/browser/fileapi/file_system_url_request_job.cc b/storage/browser/fileapi/file_system_url_request_job.cc index a670573..9572721 100644 --- a/storage/browser/fileapi/file_system_url_request_job.cc +++ b/storage/browser/fileapi/file_system_url_request_job.cc @@ -11,7 +11,6 @@ #include "base/files/file_path.h" #include "base/files/file_util_proxy.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "build/build_config.h" diff --git a/storage/browser/fileapi/file_system_url_request_job_factory.h b/storage/browser/fileapi/file_system_url_request_job_factory.h index 921b5e3..e784a31 100644 --- a/storage/browser/fileapi/file_system_url_request_job_factory.h +++ b/storage/browser/fileapi/file_system_url_request_job_factory.h @@ -11,10 +11,6 @@ #include "storage/browser/storage_browser_export.h" -namespace base { -class MessageLoopProxy; -} // namespace base - namespace storage { class FileSystemContext; diff --git a/storage/browser/fileapi/file_writer_delegate.cc b/storage/browser/fileapi/file_writer_delegate.cc index f8b1542..ab264d3 100644 --- a/storage/browser/fileapi/file_writer_delegate.cc +++ b/storage/browser/fileapi/file_writer_delegate.cc @@ -8,7 +8,6 @@ #include "base/callback.h" #include "base/files/file_util_proxy.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/sequenced_task_runner.h" #include "base/threading/thread_restrictions.h" #include "net/base/net_errors.h" diff --git a/storage/browser/quota/quota_task.cc b/storage/browser/quota/quota_task.cc index b8d4ed1..a0bda59 100644 --- a/storage/browser/quota/quota_task.cc +++ b/storage/browser/quota/quota_task.cc @@ -10,8 +10,7 @@ #include "base/bind.h" #include "base/location.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" -#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" using base::TaskRunner; @@ -30,7 +29,7 @@ void QuotaTask::Start() { QuotaTask::QuotaTask(QuotaTaskObserver* observer) : observer_(observer), - original_task_runner_(base::MessageLoopProxy::current()), + original_task_runner_(base::ThreadTaskRunnerHandle::Get()), delete_scheduled_(false) { } diff --git a/storage/common/database/database_connections.cc b/storage/common/database/database_connections.cc index adfcde1..b0b55de 100644 --- a/storage/common/database/database_connections.cc +++ b/storage/common/database/database_connections.cc @@ -8,7 +8,7 @@ #include "base/bind.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/thread_task_runner_handle.h" namespace storage { @@ -123,7 +123,7 @@ bool DatabaseConnections::RemoveConnectionsHelper( DatabaseConnectionsWrapper::DatabaseConnectionsWrapper() : waiting_for_dbs_to_close_(false), - main_thread_(base::MessageLoopProxy::current()) { + main_thread_(base::ThreadTaskRunnerHandle::Get()) { } DatabaseConnectionsWrapper::~DatabaseConnectionsWrapper() { diff --git a/storage/common/database/database_connections.h b/storage/common/database/database_connections.h index ab4812e..24bcbd0 100644 --- a/storage/common/database/database_connections.h +++ b/storage/common/database/database_connections.h @@ -15,7 +15,7 @@ #include "storage/common/storage_common_export.h" namespace base { -class MessageLoopProxy; +class SingleThreadTaskRunner; } namespace storage { @@ -91,7 +91,7 @@ class STORAGE_COMMON_EXPORT DatabaseConnectionsWrapper bool waiting_for_dbs_to_close_; base::Lock open_connections_lock_; DatabaseConnections open_connections_; - scoped_refptr<base::MessageLoopProxy> main_thread_; + scoped_refptr<base::SingleThreadTaskRunner> main_thread_; }; } // namespace storage |