summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/util
diff options
context:
space:
mode:
authoranujk.sharma <anujk.sharma@samsung.com>2015-04-29 23:51:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 06:52:23 +0000
commit171cdbe57a05e46d1e6a304f90eb2821a6e427bd (patch)
tree93530b2362f8905a3885431db0f00cf400fdbb07 /sync/internal_api/public/util
parent3a617c2b8e9378f64e73b1e2ff509de87939346f (diff)
downloadchromium_src-171cdbe57a05e46d1e6a304f90eb2821a6e427bd.zip
chromium_src-171cdbe57a05e46d1e6a304f90eb2821a6e427bd.tar.gz
chromium_src-171cdbe57a05e46d1e6a304f90eb2821a6e427bd.tar.bz2
Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in sync module.
MessageLoopProxy is deprecated. This basically does a search and replace: MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get(). BUG=391045 Review URL: https://codereview.chromium.org/1110063004 Cr-Commit-Position: refs/heads/master@{#327662}
Diffstat (limited to 'sync/internal_api/public/util')
-rw-r--r--sync/internal_api/public/util/weak_handle.cc8
-rw-r--r--sync/internal_api/public/util/weak_handle.h7
2 files changed, 6 insertions, 9 deletions
diff --git a/sync/internal_api/public/util/weak_handle.cc b/sync/internal_api/public/util/weak_handle.cc
index 0ed142e..e0864ed 100644
--- a/sync/internal_api/public/util/weak_handle.cc
+++ b/sync/internal_api/public/util/weak_handle.cc
@@ -8,17 +8,17 @@
#include "base/callback.h"
#include "base/location.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/thread_task_runner_handle.h"
namespace syncer {
namespace internal {
WeakHandleCoreBase::WeakHandleCoreBase()
- : owner_loop_proxy_(base::MessageLoopProxy::current()) {}
+ : owner_loop_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
bool WeakHandleCoreBase::IsOnOwnerThread() const {
- return owner_loop_proxy_->BelongsToCurrentThread();
+ return owner_loop_task_runner_->BelongsToCurrentThread();
}
WeakHandleCoreBase::~WeakHandleCoreBase() {}
@@ -26,7 +26,7 @@ WeakHandleCoreBase::~WeakHandleCoreBase() {}
void WeakHandleCoreBase::PostToOwnerThread(
const tracked_objects::Location& from_here,
const base::Closure& fn) const {
- if (!owner_loop_proxy_->PostTask(from_here, fn)) {
+ if (!owner_loop_task_runner_->PostTask(from_here, fn)) {
DVLOG(1) << "Could not post task from " << from_here.ToString();
}
}
diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h
index c299be7..7a11a15 100644
--- a/sync/internal_api/public/util/weak_handle.h
+++ b/sync/internal_api/public/util/weak_handle.h
@@ -58,12 +58,9 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
#include "sync/base/sync_export.h"
-namespace base {
-class MessageLoopProxy;
-} // namespace base
-
namespace tracked_objects {
class Location;
} // namespace tracked_objects
@@ -118,7 +115,7 @@ class SYNC_EXPORT WeakHandleCoreBase {
private:
// May be used on any thread.
- const scoped_refptr<base::MessageLoopProxy> owner_loop_proxy_;
+ const scoped_refptr<base::SingleThreadTaskRunner> owner_loop_task_runner_;
DISALLOW_COPY_AND_ASSIGN(WeakHandleCoreBase);
};