Commit 45a6a173 authored by Jun Cai's avatar Jun Cai Committed by Commit Bot

Convert base::Bind and base::Callback in //ppapi/shared_impl to Once or Repeating

This CL converts base::Bind and base::Callback in //ppapi/shared_impl to
Once or Repeating

Bug: 1007817
Change-Id: I5045b05239dfe9302b4df5bb035f709123de3bfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080856Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745685}
parent d7bc2eb4
......@@ -121,7 +121,7 @@ PPP_Instance_Proxy::PPP_Instance_Proxy(Dispatcher* dispatcher)
// convert it here. This magic conversion code is hardcoded into
// PluginDispatcher::OnMsgSupportsInterface.
combined_interface_.reset(PPP_Instance_Combined::Create(
base::Bind(dispatcher->local_get_interface())));
base::BindRepeating(dispatcher->local_get_interface())));
}
}
......
......@@ -9,7 +9,7 @@ namespace ppapi {
// static
PPP_Instance_Combined* PPP_Instance_Combined::Create(
base::Callback<const void*(const char*)> get_interface_func) {
base::RepeatingCallback<const void*(const char*)> get_interface_func) {
// Try 1.1.
const void* ppp_instance = get_interface_func.Run(PPP_INSTANCE_INTERFACE_1_1);
if (ppp_instance) {
......
......@@ -23,7 +23,7 @@ struct PPAPI_SHARED_EXPORT PPP_Instance_Combined {
// interface. If the plugin doesn't support any PPP_Instance interface,
// returns NULL.
static PPP_Instance_Combined* Create(
base::Callback<const void*(const char*)> get_plugin_if);
base::RepeatingCallback<const void*(const char*)> get_plugin_if);
PP_Bool DidCreate(PP_Instance instance,
uint32_t argc,
......
......@@ -66,21 +66,21 @@ class ThreadAwareCallback : public internal::ThreadAwareCallbackBase {
~ThreadAwareCallback() {}
void RunOnTargetThread() { InternalRunOnTargetThread(base::Bind(func_)); }
void RunOnTargetThread() { InternalRunOnTargetThread(base::BindOnce(func_)); }
template <class P1>
void RunOnTargetThread(const P1& p1) {
InternalRunOnTargetThread(base::Bind(func_, p1));
InternalRunOnTargetThread(base::BindOnce(func_, p1));
}
template <class P1, class P2>
void RunOnTargetThread(const P1& p1, const P2& p2) {
InternalRunOnTargetThread(base::Bind(func_, p1, p2));
InternalRunOnTargetThread(base::BindOnce(func_, p1, p2));
}
template <class P1, class P2, class P3>
void RunOnTargetThread(const P1& p1, const P2& p2, const P3& p3) {
InternalRunOnTargetThread(base::Bind(func_, p1, p2, p3));
InternalRunOnTargetThread(base::BindOnce(func_, p1, p2, p3));
}
template <class P1, class P2, class P3, class P4>
......@@ -88,7 +88,7 @@ class ThreadAwareCallback : public internal::ThreadAwareCallbackBase {
const P2& p2,
const P3& p3,
const P4& p4) {
InternalRunOnTargetThread(base::Bind(func_, p1, p2, p3, p4));
InternalRunOnTargetThread(base::BindOnce(func_, p1, p2, p3, p4));
}
template <class P1, class P2, class P3, class P4, class P5>
......@@ -97,7 +97,7 @@ class ThreadAwareCallback : public internal::ThreadAwareCallbackBase {
const P3& p3,
const P4& p4,
const P5& p5) {
InternalRunOnTargetThread(base::Bind(func_, p1, p2, p3, p4, p5));
InternalRunOnTargetThread(base::BindOnce(func_, p1, p2, p3, p4, p5));
}
private:
......
......@@ -95,7 +95,7 @@ class PPAPI_SHARED_EXPORT TrackedCallback
// far, e.g. whether the callback has been aborted. If the callback hasn't
// been aborted the return value of the task will become the callback result.
// The task is always called on the same thread as the callback to the plugin.
typedef base::Callback<int32_t(int32_t /* result */)> CompletionTask;
typedef base::RepeatingCallback<int32_t(int32_t /* result */)> CompletionTask;
// Sets a task that is run just before calling back into the plugin. This
// should only be called once. Note that the CompletionTask always runs while
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment