diff options
-rw-r--r-- | ppapi/proxy/ppapi_proxy_test.cc | 19 | ||||
-rw-r--r-- | ppapi/proxy/ppb_broker_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_core_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_file_chooser_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_file_system_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_flash_file_proxy.cc | 5 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_loader_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_var_deprecated_proxy.cc | 6 | ||||
-rw-r--r-- | ppapi/proxy/ppb_var_deprecated_proxy.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/common.cc | 3 |
10 files changed, 30 insertions, 20 deletions
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc index 76034d7..13bbe14 100644 --- a/ppapi/proxy/ppapi_proxy_test.cc +++ b/ppapi/proxy/ppapi_proxy_test.cc @@ -4,6 +4,7 @@ #include "ppapi/proxy/ppapi_proxy_test.h" +#include "base/bind.h" #include "base/message_loop_proxy.h" #include "base/observer_list.h" #include "ipc/ipc_sync_channel.h" @@ -345,12 +346,12 @@ void TwoWayTest::SetUp() { base::WaitableEvent remote_harness_set_up(true, false); plugin_thread_.message_loop_proxy()->PostTask( FROM_HERE, - NewRunnableFunction(&SetUpRemoteHarness, - remote_harness_, - handle, - io_thread_.message_loop_proxy(), - &shutdown_event_, - &remote_harness_set_up)); + base::Bind(&SetUpRemoteHarness, + remote_harness_, + handle, + io_thread_.message_loop_proxy(), + &shutdown_event_, + &remote_harness_set_up)); remote_harness_set_up.Wait(); local_harness_->SetUpHarnessWithChannel(handle, io_thread_.message_loop_proxy(), @@ -362,9 +363,9 @@ void TwoWayTest::TearDown() { base::WaitableEvent remote_harness_torn_down(true, false); plugin_thread_.message_loop_proxy()->PostTask( FROM_HERE, - NewRunnableFunction(&TearDownRemoteHarness, - remote_harness_, - &remote_harness_torn_down)); + base::Bind(&TearDownRemoteHarness, + remote_harness_, + &remote_harness_torn_down)); remote_harness_torn_down.Wait(); local_harness_->TearDownHarness(); diff --git a/ppapi/proxy/ppb_broker_proxy.cc b/ppapi/proxy/ppb_broker_proxy.cc index f584cf0..d0f7112 100644 --- a/ppapi/proxy/ppb_broker_proxy.cc +++ b/ppapi/proxy/ppb_broker_proxy.cc @@ -4,6 +4,7 @@ #include "ppapi/proxy/ppb_broker_proxy.h" +#include "base/bind.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/trusted/ppb_broker_trusted.h" #include "ppapi/proxy/enter_proxy.h" @@ -83,7 +84,7 @@ Broker::~Broker() { if (current_connect_callback_.func) { // TODO(brettw) the callbacks at this level should be refactored with a // more automatic tracking system like we have in the renderer. - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( + MessageLoop::current()->PostTask(FROM_HERE, base::Bind( current_connect_callback_.func, current_connect_callback_.user_data, static_cast<int32_t>(PP_ERROR_ABORTED))); } diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc index d3d17c0..7e87241 100644 --- a/ppapi/proxy/ppb_core_proxy.cc +++ b/ppapi/proxy/ppb_core_proxy.cc @@ -6,6 +6,7 @@ #include <stdlib.h> // For malloc +#include "base/bind.h" #include "base/debug/trace_event.h" #include "base/logging.h" #include "base/message_loop.h" @@ -58,7 +59,7 @@ void CallOnMainThread(int delay_in_ms, int32_t result) { GetMainThreadMessageLoop()->PostDelayedTask( FROM_HERE, - NewRunnableFunction(&CallbackWrapper, callback, result), + base::Bind(&CallbackWrapper, callback, result), delay_in_ms); } diff --git a/ppapi/proxy/ppb_file_chooser_proxy.cc b/ppapi/proxy/ppb_file_chooser_proxy.cc index c74ba4f..d6850a5 100644 --- a/ppapi/proxy/ppb_file_chooser_proxy.cc +++ b/ppapi/proxy/ppb_file_chooser_proxy.cc @@ -6,6 +6,7 @@ #include <queue> +#include "base/bind.h" #include "ppapi/c/dev/ppb_file_chooser_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_proxy_private.h" @@ -64,7 +65,7 @@ FileChooser::~FileChooser() { if (current_show_callback_.func) { // TODO(brettw) the callbacks at this level should be refactored with a // more automatic tracking system like we have in the renderer. - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( + MessageLoop::current()->PostTask(FROM_HERE, base::Bind( current_show_callback_.func, current_show_callback_.user_data, static_cast<int32_t>(PP_ERROR_ABORTED))); } diff --git a/ppapi/proxy/ppb_file_system_proxy.cc b/ppapi/proxy/ppb_file_system_proxy.cc index 8fc7b55..606f2e0 100644 --- a/ppapi/proxy/ppb_file_system_proxy.cc +++ b/ppapi/proxy/ppb_file_system_proxy.cc @@ -4,6 +4,7 @@ #include "ppapi/proxy/ppb_file_system_proxy.h" +#include "base/bind.h" #include "base/message_loop.h" #include "base/task.h" #include "ppapi/c/pp_errors.h" @@ -76,7 +77,7 @@ FileSystem::~FileSystem() { if (current_open_callback_.func) { // TODO(brettw) the callbacks at this level should be refactored with a // more automatic tracking system like we have in the renderer. - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( + MessageLoop::current()->PostTask(FROM_HERE, base::Bind( current_open_callback_.func, current_open_callback_.user_data, static_cast<int32_t>(PP_ERROR_ABORTED))); } diff --git a/ppapi/proxy/ppb_flash_file_proxy.cc b/ppapi/proxy/ppb_flash_file_proxy.cc index 5f7ef23..fa636aa 100644 --- a/ppapi/proxy/ppb_flash_file_proxy.cc +++ b/ppapi/proxy/ppb_flash_file_proxy.cc @@ -8,6 +8,7 @@ #include <set> #include <vector> +#include "base/bind.h" #include "base/logging.h" #include "base/message_loop_proxy.h" #include "base/synchronization/lock.h" @@ -314,8 +315,8 @@ bool ModuleLocalThreadAdapter::Send(PP_Instance instance, IPC::Message* msg) { // random place, but it should actually still work (since the Flash file // operations are global). io_thread_->PostTask(FROM_HERE, - NewRunnableMethod(this, &ModuleLocalThreadAdapter::SendFromIOThread, - dispatcher, msg)); + base::Bind(&ModuleLocalThreadAdapter::SendFromIOThread, this, + dispatcher, msg)); // Now we block the current thread waiting for the reply. event.Wait(); diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc index ce4bc62..70c01e8 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.cc +++ b/ppapi/proxy/ppb_url_loader_proxy.cc @@ -8,6 +8,7 @@ #include <deque> #include <vector> +#include "base/bind.h" #include "base/logging.h" #include "build/build_config.h" #include "ppapi/c/pp_completion_callback.h" @@ -165,7 +166,7 @@ URLLoader::~URLLoader() { if (current_read_callback_.func) { // TODO(brettw) the callbacks at this level should be refactored with a // more automatic tracking system like we have in the renderer. - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( + MessageLoop::current()->PostTask(FROM_HERE, base::Bind( current_read_callback_.func, current_read_callback_.user_data, static_cast<int32_t>(PP_ERROR_ABORTED))); } diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.cc b/ppapi/proxy/ppb_var_deprecated_proxy.cc index f4a4431..6475580 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.cc +++ b/ppapi/proxy/ppb_var_deprecated_proxy.cc @@ -6,6 +6,7 @@ #include <stdlib.h> // For malloc +#include "base/bind.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/task.h" @@ -386,8 +387,9 @@ void PPB_Var_Deprecated_Proxy::OnMsgReleaseObject(int64 object_id) { // TODO(piman): See if we can fix the IPC code to enforce strict ordering, and // then remove this. MessageLoop::current()->PostNonNestableTask(FROM_HERE, - task_factory_.NewRunnableMethod( - &PPB_Var_Deprecated_Proxy::DoReleaseObject, object_id)); + base::Bind(&PPB_Var_Deprecated_Proxy::DoReleaseObject, + task_factory_.GetWeakPtr(), + object_id)); } void PPB_Var_Deprecated_Proxy::OnMsgHasProperty( diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.h b/ppapi/proxy/ppb_var_deprecated_proxy.h index ac8c1fd..1eb62c6 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.h +++ b/ppapi/proxy/ppb_var_deprecated_proxy.h @@ -90,7 +90,7 @@ class PPB_Var_Deprecated_Proxy : public InterfaceProxy { void SetAllowPluginReentrancy(); void DoReleaseObject(int64 object_id); - ScopedRunnableMethodFactory<PPB_Var_Deprecated_Proxy> task_factory_; + base::WeakPtrFactory<PPB_Var_Deprecated_Proxy> task_factory_; const PPB_Var_Deprecated* ppb_var_impl_; diff --git a/ppapi/thunk/common.cc b/ppapi/thunk/common.cc index b59f139..9a952a2 100644 --- a/ppapi/thunk/common.cc +++ b/ppapi/thunk/common.cc @@ -4,6 +4,7 @@ #include "ppapi/thunk/common.h" +#include "base/bind.h" #include "base/message_loop.h" #include "ppapi/c/pp_errors.h" @@ -21,7 +22,7 @@ int32_t MayForceCallback(PP_CompletionCallback callback, int32_t result) { // TODO(polina): make this work off the main thread as well // (At this point this should not be an issue because PPAPI is only supported // on the main thread). - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( + MessageLoop::current()->PostTask(FROM_HERE, base::Bind( callback.func, callback.user_data, result)); return PP_OK_COMPLETIONPENDING; } |