diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-12 17:10:58 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-12 17:10:58 +0000 |
commit | 8075105cb6bc684ebfe613edd6a9a27384c80d7e (patch) | |
tree | 86386ce875a2fd3e08db4fd4cd9f6e9b09c096cb /chrome_frame/vtable_patch_manager_unittest.cc | |
parent | 82f4b8292a2bf50213b9ae86399303f907e930e0 (diff) | |
download | chromium_src-8075105cb6bc684ebfe613edd6a9a27384c80d7e.zip chromium_src-8075105cb6bc684ebfe613edd6a9a27384c80d7e.tar.gz chromium_src-8075105cb6bc684ebfe613edd6a9a27384c80d7e.tar.bz2 |
base::Bind: Low-hanging fruit conversions of NewRunnableFunction.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8536037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109803 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/vtable_patch_manager_unittest.cc')
-rw-r--r-- | chrome_frame/vtable_patch_manager_unittest.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chrome_frame/vtable_patch_manager_unittest.cc b/chrome_frame/vtable_patch_manager_unittest.cc index 82b3772..2176a05 100644 --- a/chrome_frame/vtable_patch_manager_unittest.cc +++ b/chrome_frame/vtable_patch_manager_unittest.cc @@ -6,6 +6,8 @@ #include <unknwn.h> +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/message_loop.h" #include "base/threading/thread.h" #include "base/win/scoped_handle.h" @@ -217,15 +219,16 @@ TEST_F(VtablePatchManagerTest, ThreadSafePatching) { vtable_patch::patch_lock_.Acquire(); // Instruct the background thread to patch factory_. - background.message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(&vtable_patch::PatchInterfaceMethods, - &factory_, - &IClassFactory_PatchInfo[0])); + background.message_loop()->PostTask( + FROM_HERE, + base::IgnoreReturn<HRESULT>( + base::Bind(&vtable_patch::PatchInterfaceMethods, &factory_, + &IClassFactory_PatchInfo[0]))); // And subsequently to signal the event. Neither of these actions should // occur until we've released the patch lock. - background.message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(::SetEvent, event.Get())); + background.message_loop()->PostTask( + FROM_HERE, base::IgnoreReturn<BOOL>(base::Bind(::SetEvent, event.Get()))); // Wait for a little while, to give the background thread time to process. // We expect this wait to time out, as the background thread should end up @@ -258,14 +261,16 @@ TEST_F(VtablePatchManagerTest, ThreadSafePatching) { vtable_patch::patch_lock_.Acquire(); // Instruct the background thread to unpatch. - background.message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(&vtable_patch::UnpatchInterfaceMethods, - &IClassFactory_PatchInfo[0])); + background.message_loop()->PostTask( + FROM_HERE, + base::IgnoreReturn<HRESULT>( + base::Bind(&vtable_patch::UnpatchInterfaceMethods, + &IClassFactory_PatchInfo[0]))); // And subsequently to signal the event. Neither of these actions should // occur until we've released the patch lock. - background.message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(::SetEvent, event.Get())); + background.message_loop()->PostTask( + FROM_HERE, base::IgnoreReturn<BOOL>(base::Bind(::SetEvent, event.Get()))); // Wait for a little while, to give the background thread time to process. // We expect this wait to time out, as the background thread should end up |