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 | |
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
20 files changed, 87 insertions, 78 deletions
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index 50dfed69..bf85409 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -6,6 +6,7 @@ #include "testing/gtest/include/gtest/gtest.h" +#include "base/bind.h" #include "base/location.h" #include "base/synchronization/waitable_event.h" #include "base/task.h" @@ -187,9 +188,9 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { void FlushLastDBTask() { base::WaitableEvent done(false, false); - BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - NewRunnableFunction(&ProfileSyncServicePasswordTest::SignalEvent, - &done)); + BrowserThread::PostTask( + BrowserThread::DB, FROM_HERE, + base::Bind(&ProfileSyncServicePasswordTest::SignalEvent, &done)); done.TimedWait(base::TimeDelta::FromMilliseconds( TestTimeouts::action_timeout_ms())); } diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc index d031587..132c918 100644 --- a/chrome/browser/ui/auto_login_prompter.cc +++ b/chrome/browser/ui/auto_login_prompter.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/auto_login_prompter.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -271,9 +272,10 @@ void AutoLoginPrompter::ShowInfoBarIfPossible(net::URLRequest* request, if (realm != "com.google") return; - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - NewRunnableFunction(&AutoLoginPrompter::ShowInfoBarUIThread, account, - args, child_id, route_id)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::Bind(&AutoLoginPrompter::ShowInfoBarUIThread, account, args, + child_id, route_id)); } // static diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc index a5d0be6..2e22743 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.cc +++ b/chrome/service/cloud_print/cloud_print_proxy.cc @@ -4,6 +4,7 @@ #include "chrome/service/cloud_print/cloud_print_proxy.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/path_service.h" #include "base/process_util.h" @@ -221,7 +222,7 @@ void CloudPrintProxy::OnAuthenticationFailed() { // expired (unless error dialogs are disabled). if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoErrorDialogs)) g_service_process->io_thread()->message_loop_proxy()->PostTask( - FROM_HERE, NewRunnableFunction(&ShowTokenExpiredNotificationInBrowser)); + FROM_HERE, base::Bind(&ShowTokenExpiredNotificationInBrowser)); } void CloudPrintProxy::OnPrintSystemUnavailable() { diff --git a/chrome_frame/crash_reporting/nt_loader_unittest.cc b/chrome_frame/crash_reporting/nt_loader_unittest.cc index 4f75d74..3bc27bf 100644 --- a/chrome_frame/crash_reporting/nt_loader_unittest.cc +++ b/chrome_frame/crash_reporting/nt_loader_unittest.cc @@ -8,6 +8,8 @@ #include <winnt.h> #include "base/at_exit.h" +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/environment.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" @@ -81,11 +83,11 @@ TEST(NtLoader, OwnsCriticalSection) { base::Thread other("Other threads"); ASSERT_TRUE(other.Start()); other.message_loop()->PostTask( - FROM_HERE, NewRunnableFunction(::EnterCriticalSection, &cs)); + FROM_HERE, base::Bind(::EnterCriticalSection, &cs)); base::win::ScopedHandle event(::CreateEvent(NULL, FALSE, FALSE, NULL)); other.message_loop()->PostTask( - FROM_HERE, NewRunnableFunction(::SetEvent, event.Get())); + FROM_HERE, base::IgnoreReturn<BOOL>(base::Bind(::SetEvent, event.Get()))); ASSERT_EQ(WAIT_OBJECT_0, ::WaitForSingleObject(event.Get(), INFINITE)); @@ -96,7 +98,7 @@ TEST(NtLoader, OwnsCriticalSection) { // Make the other thread release it. other.message_loop()->PostTask( - FROM_HERE, NewRunnableFunction(::LeaveCriticalSection, &cs)); + FROM_HERE, base::Bind(::LeaveCriticalSection, &cs)); other.Stop(); diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index c33b54c..b597289 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -8,6 +8,7 @@ #include <atlcom.h> #include <exdisp.h> +#include "base/bind.h" #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/file_util.h" @@ -416,7 +417,7 @@ DWORD CFUrlRequestUnittestRunner::RunAllUnittests(void* param) { reinterpret_cast<CFUrlRequestUnittestRunner*>(param); me->test_result_ = me->Run(); me->fake_chrome_.ui_loop()->PostTask(FROM_HERE, - NewRunnableFunction(TakeDownBrowser, me)); + base::Bind(TakeDownBrowser, me)); return 0; } diff --git a/chrome_frame/test/net/test_automation_resource_message_filter.cc b/chrome_frame/test/net/test_automation_resource_message_filter.cc index f7f00bc..655950c 100644 --- a/chrome_frame/test/net/test_automation_resource_message_filter.cc +++ b/chrome_frame/test/net/test_automation_resource_message_filter.cc @@ -1,9 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome_frame/test/net/test_automation_resource_message_filter.h" +#include "base/bind.h" + TestAutomationResourceMessageFilter::TestAutomationResourceMessageFilter( AutomationProvider* automation) : automation_(automation) { } @@ -32,8 +34,8 @@ bool TestAutomationResourceMessageFilter::OnMessageReceived( handled = true; IPC::Message* msg = new IPC::Message(message); RequestJob& job = it->second; - job.loop_->PostTask(FROM_HERE, NewRunnableFunction(OnRequestMessage, - job.job_, msg)); + job.loop_->PostTask(FROM_HERE, + base::Bind(OnRequestMessage, job.job_, msg)); } } else { handled = AutomationResourceMessageFilter::OnMessageReceived(message); diff --git a/chrome_frame/test/test_server_test.cc b/chrome_frame/test/test_server_test.cc index e358e99..4175d22 100644 --- a/chrome_frame/test/test_server_test.cc +++ b/chrome_frame/test/test_server_test.cc @@ -6,6 +6,7 @@ #include <wininet.h> #include "base/basictypes.h" +#include "base/bind.h" #include "base/path_service.h" #include "base/win/scoped_handle.h" #include "chrome_frame/test/test_server.h" @@ -145,8 +146,7 @@ TEST_F(TestServerTest, TestServer) { // We should never hit this, but it's our way to break out of the test if // things start hanging. QuitMessageHit quit_msg(&loop); - loop.PostDelayedTask(FROM_HERE, - NewRunnableFunction(QuitMessageLoop, &quit_msg), + loop.PostDelayedTask(FROM_HERE, base::Bind(QuitMessageLoop, &quit_msg), 10 * 1000); UrlTaskChain quit_task("http://localhost:1337/quit", NULL); diff --git a/chrome_frame/test/urlmon_moniker_integration_test.cc b/chrome_frame/test/urlmon_moniker_integration_test.cc index 0812b53..7c656a8 100644 --- a/chrome_frame/test/urlmon_moniker_integration_test.cc +++ b/chrome_frame/test/urlmon_moniker_integration_test.cc @@ -5,6 +5,7 @@ #include <atlbase.h> #include <atlcom.h> +#include "base/bind.h" #include "base/threading/thread.h" #include "base/win/scoped_comptr.h" #include "base/win/scoped_handle.h" @@ -67,7 +68,7 @@ class RunTestServer : public base::Thread { bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); if (ret) { message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(&RunTestServer::StartServer, this)); + base::Bind(&RunTestServer::StartServer, this)); wait_until_ready(); } return ret; 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 diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index 11ccecc..fee3fa1 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -92,7 +92,7 @@ class BrowserThreadTest : public testing::Test { TEST_F(BrowserThreadTest, PostTask) { BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, - NewRunnableFunction(&BasicFunction, MessageLoop::current())); + base::Bind(&BasicFunction, MessageLoop::current())); MessageLoop::current()->Run(); } @@ -124,9 +124,8 @@ TEST_F(BrowserThreadTest, NotReleasedIfTargetThreadNonExistent) { TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); - message_loop_proxy->PostTask(FROM_HERE, - NewRunnableFunction(&BasicFunction, - MessageLoop::current())); + message_loop_proxy->PostTask( + FROM_HERE, base::Bind(&BasicFunction, MessageLoop::current())); MessageLoop::current()->Run(); } diff --git a/content/browser/file_system/file_system_browsertest.cc b/content/browser/file_system/file_system_browsertest.cc index 1b4a0fd..a755a59 100644 --- a/content/browser/file_system/file_system_browsertest.cc +++ b/content/browser/file_system/file_system_browsertest.cc @@ -63,9 +63,10 @@ class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - NewRunnableFunction(&FileSystemBrowserTestWithLowQuota::SetTempQuota, - bytes, qm)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&FileSystemBrowserTestWithLowQuota::SetTempQuota, bytes, + qm)); return; } DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index b21a5da..f155279 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -13,6 +13,7 @@ #include <vector> #include "base/base_switches.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" @@ -95,7 +96,7 @@ void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(ReparentPluginWindowHelper, window, parent)); + base::Bind(ReparentPluginWindowHelper, window, parent)); } #endif // defined(OS_WIN) @@ -141,10 +142,9 @@ PluginProcessHost::~PluginProcessHost() { if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { base::mac::ReleaseFullScreen(base::mac::kFullScreenModeHideAll); } else { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::ReleaseFullScreen, - base::mac::kFullScreenModeHideAll)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(base::mac::ReleaseFullScreen, + base::mac::kFullScreenModeHideAll)); } } // If the plugin hid the cursor, reset that. @@ -152,10 +152,8 @@ PluginProcessHost::~PluginProcessHost() { if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { base::mac::SetCursorVisibility(true); } else { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::SetCursorVisibility, - true)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(base::mac::SetCursorVisibility, true)); } } #endif diff --git a/content/browser/plugin_process_host_mac.cc b/content/browser/plugin_process_host_mac.cc index 95b9a84..99e3e27 100644 --- a/content/browser/plugin_process_host_mac.cc +++ b/content/browser/plugin_process_host_mac.cc @@ -8,6 +8,7 @@ #include <vector> +#include "base/bind.h" #include "base/logging.h" #include "base/mac/mac_util.h" #include "content/browser/plugin_process_host.h" @@ -44,10 +45,9 @@ void PluginProcessHost::OnPluginShowWindow(uint32 window_id, // the main display, hide the menubar so that it has the whole screen. // (but only if we haven't already seen this fullscreen window, since // otherwise our refcounting can get skewed). - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::RequestFullScreen, - base::mac::kFullScreenModeHideAll)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(base::mac::RequestFullScreen, + base::mac::kFullScreenModeHideAll)); } } @@ -77,16 +77,14 @@ void PluginProcessHost::OnPluginHideWindow(uint32 window_id, plugin_fullscreen_windows_set_.erase(window_id); pid_t plugin_pid = browser_needs_activation ? -1 : handle(); browser_needs_activation = false; - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(ReleasePluginFullScreen, plugin_pid)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(ReleasePluginFullScreen, plugin_pid)); } if (browser_needs_activation) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::ActivateProcess, - base::GetCurrentProcId())); + base::Bind(base::mac::ActivateProcess, base::GetCurrentProcId())); } } @@ -96,18 +94,16 @@ void PluginProcessHost::OnAppActivation() { // If our plugin process has any modal windows up, we need to bring it forward // so that they act more like an in-process modal window would. if (!plugin_modal_windows_set_.empty()) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::ActivateProcess, handle())); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(base::mac::ActivateProcess, handle())); } } void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) { if (plugin_cursor_visible_ != visible) { plugin_cursor_visible_ = visible; - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(base::mac::SetCursorVisibility, - visible)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(base::mac::SetCursorVisibility, + visible)); } } diff --git a/content/browser/plugin_service_browsertest.cc b/content/browser/plugin_service_browsertest.cc index 116a6e1..c8f8e1e 100644 --- a/content/browser/plugin_service_browsertest.cc +++ b/content/browser/plugin_service_browsertest.cc @@ -168,9 +168,8 @@ void OpenChannelAndThenCancel(PluginProcessHost::Client* client) { IN_PROC_BROWSER_TEST_F(PluginServiceTest, CancelOpenChannelToPluginService) { ::testing::StrictMock<MockCanceledPluginServiceClient> mock_client( browser()->profile()->GetResourceContext()); - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - NewRunnableFunction(OpenChannelAndThenCancel, &mock_client)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::Bind(OpenChannelAndThenCancel, &mock_client)); ui_test_utils::RunMessageLoop(); EXPECT_TRUE(mock_client.get_resource_context_called()); } diff --git a/content/browser/user_metrics.cc b/content/browser/user_metrics.cc index 6f0a35f..b359654 100644 --- a/content/browser/user_metrics.cc +++ b/content/browser/user_metrics.cc @@ -4,6 +4,7 @@ #include "content/browser/user_metrics.h" +#include "base/bind.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" @@ -20,9 +21,8 @@ void UserMetrics::RecordComputedAction(const std::string& action) { void UserMetrics::Record(const char *action) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(&UserMetrics::CallRecordOnUI, action)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(&UserMetrics::CallRecordOnUI, action)); return; } diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 0004357..02c38af 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -7,6 +7,7 @@ #include <string> #include <vector> +#include "base/bind.h" #include "base/command_line.h" #include "base/threading/worker_pool.h" #include "base/win/scoped_com_initializer.h" @@ -175,8 +176,7 @@ void GpuChildThread::OnCollectGraphicsInfo() { // Asynchronously collect the DirectX diagnostics because this can take a // couple of seconds. if (!base::WorkerPool::PostTask( - FROM_HERE, - NewRunnableFunction(&GpuChildThread::CollectDxDiagnostics, this), + FROM_HERE, base::Bind(&GpuChildThread::CollectDxDiagnostics, this), true)) { // Flag GPU info as complete if the DirectX diagnostics cannot be // collected. @@ -223,8 +223,7 @@ void GpuChildThread::CollectDxDiagnostics(GpuChildThread* thread) { gpu_info_collector::GetDxDiagnostics(&node); thread->message_loop()->PostTask( - FROM_HERE, - NewRunnableFunction(&GpuChildThread::SetDxDiagnostics, thread, node)); + FROM_HERE, base::Bind(&GpuChildThread::SetDxDiagnostics, thread, node)); } // Runs on the main thread. diff --git a/content/renderer/devtools_agent_filter.cc b/content/renderer/devtools_agent_filter.cc index 281ddf2..04d4b2a 100644 --- a/content/renderer/devtools_agent_filter.cc +++ b/content/renderer/devtools_agent_filter.cc @@ -1,9 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/renderer/devtools_agent_filter.h" +#include "base/bind.h" #include "base/message_loop.h" #include "content/common/devtools_messages.h" #include "content/renderer/devtools_agent.h" @@ -93,6 +94,5 @@ void DevToolsAgentFilter::OnDispatchOnInspectorBackend( new MessageImpl(message, current_routing_id_)); render_thread_loop_->PostTask( - FROM_HERE, - NewRunnableFunction(&WebDevToolsAgent::processPendingMessages)); + FROM_HERE, base::Bind(&WebDevToolsAgent::processPendingMessages)); } diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index a336404..3874d80 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -4,6 +4,7 @@ #include "content/shell/shell_browser_main.h" +#include "base/bind.h" #include "base/message_loop.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" @@ -31,8 +32,8 @@ ShellBrowserMainParts::ShellBrowserMainParts( ShellBrowserMainParts::~ShellBrowserMainParts() { base::ThreadRestrictions::SetIOAllowed(true); io_thread()->message_loop()->PostTask( - FROM_HERE, - NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); + FROM_HERE, base::IgnoreReturn<bool>( + base::Bind(&base::ThreadRestrictions::SetIOAllowed, true))); browser_context_.reset(); diff --git a/net/test/test_server_win.cc b/net/test/test_server_win.cc index 5d7fa88..ee62d1df 100644 --- a/net/test/test_server_win.cc +++ b/net/test/test_server_win.cc @@ -8,6 +8,7 @@ #include <wincrypt.h> #include "base/base_paths.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/message_loop.h" @@ -50,8 +51,7 @@ bool ReadData(HANDLE read_fd, HANDLE write_fd, // Prepare a timeout in case the server fails to start. bool unblocked = false; thread.message_loop()->PostDelayedTask( - FROM_HERE, - NewRunnableFunction(UnblockPipe, write_fd, bytes_max, &unblocked), + FROM_HERE, base::Bind(UnblockPipe, write_fd, bytes_max, &unblocked), TestTimeouts::action_timeout_ms()); DWORD bytes_read = 0; diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc index ce9cf2e..4ab1a54 100644 --- a/webkit/glue/webkitplatformsupport_impl.cc +++ b/webkit/glue/webkitplatformsupport_impl.cc @@ -12,6 +12,7 @@ #include <vector> +#include "base/bind.h" #include "base/debug/trace_event.h" #include "base/memory/singleton.h" #include "base/message_loop.h" @@ -543,7 +544,7 @@ void WebKitPlatformSupportImpl::stopSharedTimer() { void WebKitPlatformSupportImpl::callOnMainThread( void (*func)(void*), void* context) { - main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func, context)); + main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); } WebKit::WebThread* WebKitPlatformSupportImpl::createThread(const char* name) { |