summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 22:25:21 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 22:25:21 +0000
commit32876aeb6bbb36b4c0cb928fa578f10d306337b0 (patch)
treefe42b86df7c9e71ac7fd9d0804e103e4e12111a0
parent360e7a03b7265826324fe5727636f5e83490e8ab (diff)
downloadchromium_src-32876aeb6bbb36b4c0cb928fa578f10d306337b0.zip
chromium_src-32876aeb6bbb36b4c0cb928fa578f10d306337b0.tar.gz
chromium_src-32876aeb6bbb36b4c0cb928fa578f10d306337b0.tar.bz2
base::Bind: Convert content/renderer.
BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/8554001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110189 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/gpu/gpu_channel_host.cc27
-rw-r--r--content/renderer/gpu/transport_texture_host.cc16
-rw-r--r--content/renderer/gpu/transport_texture_host.h9
-rw-r--r--content/renderer/gpu/transport_texture_service.cc10
-rw-r--r--content/renderer/load_progress_tracker.cc17
-rw-r--r--content/renderer/load_progress_tracker.h6
-rw-r--r--content/renderer/p2p/ipc_network_manager.cc7
-rw-r--r--content/renderer/p2p/ipc_network_manager.h4
-rw-r--r--content/renderer/p2p/p2p_transport_impl_unittest.cc11
-rw-r--r--content/renderer/p2p/socket_client.cc31
-rw-r--r--content/renderer/render_view_impl.cc2
-rw-r--r--content/renderer/render_widget.cc30
12 files changed, 84 insertions, 86 deletions
diff --git a/content/renderer/gpu/gpu_channel_host.cc b/content/renderer/gpu/gpu_channel_host.cc
index d66c72a..84e0dae 100644
--- a/content/renderer/gpu/gpu_channel_host.cc
+++ b/content/renderer/gpu/gpu_channel_host.cc
@@ -4,6 +4,7 @@
#include "content/renderer/gpu/gpu_channel_host.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "content/common/child_process.h"
@@ -79,10 +80,8 @@ bool GpuChannelHost::MessageFilter::OnMessageReceived(
const scoped_refptr<GpuChannelHost::Listener>& listener = it->second;
listener->loop()->PostTask(
FROM_HERE,
- NewRunnableMethod(
- listener.get(),
- &GpuChannelHost::Listener::DispatchMessage,
- message));
+ base::Bind(&GpuChannelHost::Listener::DispatchMessage, listener.get(),
+ message));
}
return true;
@@ -98,9 +97,7 @@ void GpuChannelHost::MessageFilter::OnChannelError() {
const scoped_refptr<GpuChannelHost::Listener>& listener = it->second;
listener->loop()->PostTask(
FROM_HERE,
- NewRunnableMethod(
- listener.get(),
- &GpuChannelHost::Listener::DispatchError));
+ base::Bind(&GpuChannelHost::Listener::DispatchError, listener.get()));
}
listeners_.clear();
@@ -108,8 +105,7 @@ void GpuChannelHost::MessageFilter::OnChannelError() {
ChildThread* main_thread = RenderProcess::current()->main_thread();
MessageLoop* main_loop = main_thread->message_loop();
main_loop->PostTask(FROM_HERE,
- NewRunnableMethod(parent_,
- &GpuChannelHost::OnChannelError));
+ base::Bind(&GpuChannelHost::OnChannelError, parent_));
}
GpuChannelHost::GpuChannelHost()
@@ -312,19 +308,16 @@ void GpuChannelHost::AddRoute(
MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy();
io_loop->PostTask(FROM_HERE,
- NewRunnableMethod(
- channel_filter_.get(),
- &GpuChannelHost::MessageFilter::AddRoute,
- route_id, listener, MessageLoopProxy::current()));
+ base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
+ channel_filter_.get(), route_id, listener,
+ MessageLoopProxy::current()));
}
void GpuChannelHost::RemoveRoute(int route_id) {
MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy();
io_loop->PostTask(FROM_HERE,
- NewRunnableMethod(
- channel_filter_.get(),
- &GpuChannelHost::MessageFilter::RemoveRoute,
- route_id));
+ base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute,
+ channel_filter_.get(), route_id));
}
bool GpuChannelHost::WillGpuSwitchOccur(
diff --git a/content/renderer/gpu/transport_texture_host.cc b/content/renderer/gpu/transport_texture_host.cc
index 22eecae..055d21f 100644
--- a/content/renderer/gpu/transport_texture_host.cc
+++ b/content/renderer/gpu/transport_texture_host.cc
@@ -11,6 +11,7 @@
// solved yet so exclude building on Mac.
#if !defined(OS_MACOSX)
+#include "base/bind.h"
#include "base/message_loop.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/renderer/gpu/renderer_gl_context.h"
@@ -41,7 +42,7 @@ void TransportTextureHost::Init(Task* done_task) {
if (MessageLoop::current() != io_message_loop_) {
io_message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureHost::Init, done_task));
+ base::Bind(&TransportTextureHost::Init, this, done_task));
return;
}
@@ -102,8 +103,7 @@ void TransportTextureHost::ReleaseTexturesInternal() {
if (MessageLoop::current() != render_message_loop_) {
render_message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this,
- &TransportTextureHost::ReleaseTexturesInternal));
+ base::Bind(&TransportTextureHost::ReleaseTexturesInternal, this));
return;
}
@@ -118,8 +118,8 @@ void TransportTextureHost::SendTexturesInternal(
if (MessageLoop::current() != io_message_loop_) {
io_message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureHost::SendTexturesInternal,
- textures));
+ base::Bind(&TransportTextureHost::SendTexturesInternal, this,
+ textures));
return;
}
@@ -134,7 +134,7 @@ void TransportTextureHost::SendDestroyInternal() {
if (MessageLoop::current() != io_message_loop_) {
io_message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureHost::SendDestroyInternal));
+ base::Bind(&TransportTextureHost::SendDestroyInternal, this));
return;
}
@@ -157,8 +157,8 @@ void TransportTextureHost::OnCreateTextures(int32 n, uint32 width,
if (MessageLoop::current() != render_message_loop_) {
render_message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureHost::OnCreateTextures,
- n, width, height, format));
+ base::Bind(&TransportTextureHost::OnCreateTextures, this, n, width,
+ height, format));
return;
}
diff --git a/content/renderer/gpu/transport_texture_host.h b/content/renderer/gpu/transport_texture_host.h
index 71e90c8..333a716 100644
--- a/content/renderer/gpu/transport_texture_host.h
+++ b/content/renderer/gpu/transport_texture_host.h
@@ -52,16 +52,16 @@
// void MyObjectInitDone() {
// std::vector<int> textures;
// factory_host.GetTextures(
-// NewCallback(&handler, &TextureUpdateHandler::OnTextureUpdate),
+// base::Bind(&TextureUpdateHandler::OnTextureUpdate, &handler),
// &textures);
// }
//
// void InitDone() {
// InitMyObjectInGPUProcess(factory_host.GetPeerId(),
-// NewRunnableFunction(&MyObjectInitDone));
+// base::Bind(&MyObjectInitDone));
// }
//
-// factory_host.Init(NewRunnableFunction(&InitDone));
+// factory_host.Init(base::Bind(&InitDone));
//
// ----------------------
// | In the GPU process |
@@ -83,8 +83,7 @@
//
// void OnInit() {
// factory->CreateTextures(3, 1024, 768, TransportTexture::RGB, &textures,
-// NewRunnableFunction(&TextureCreateDone),
-// textures);
+// base::Bind(&TextureCreateDone), textures);
// }
#ifndef CONTENT_RENDERER_GPU_TRANSPORT_TEXTURE_HOST_H_
diff --git a/content/renderer/gpu/transport_texture_service.cc b/content/renderer/gpu/transport_texture_service.cc
index a0d9292..c415f98 100644
--- a/content/renderer/gpu/transport_texture_service.cc
+++ b/content/renderer/gpu/transport_texture_service.cc
@@ -4,6 +4,7 @@
#include "content/renderer/gpu/transport_texture_service.h"
+#include "base/bind.h"
#include "base/stl_util.h"
#include "content/common/child_process.h"
#include "content/common/gpu/gpu_messages.h"
@@ -71,8 +72,8 @@ TransportTextureService::CreateTransportTextureHost(
// Add route in the IO thread.
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureService::AddRouteInternal,
- next_host_id_, host));
+ base::Bind(&TransportTextureService::AddRouteInternal, this,
+ next_host_id_, host));
// Increment host ID for next object.
++next_host_id_;
@@ -86,14 +87,13 @@ TransportTextureService::CreateTransportTextureHost(
void TransportTextureService::RemoveRoute(int32 host_id) {
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureService::RemoveRouteInternal,
- host_id));
+ base::Bind(&TransportTextureService::RemoveRouteInternal, this, host_id));
}
bool TransportTextureService::Send(IPC::Message* msg) {
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &TransportTextureService::SendInternal, msg));
+ base::Bind(&TransportTextureService::SendInternal, this, msg));
return true;
}
diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc
index c4ceb5e..cc153f6 100644
--- a/content/renderer/load_progress_tracker.cc
+++ b/content/renderer/load_progress_tracker.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2010 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/load_progress_tracker.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "content/common/view_messages.h"
#include "content/renderer/render_view_impl.h"
@@ -18,7 +19,7 @@ LoadProgressTracker::LoadProgressTracker(RenderViewImpl* render_view)
: render_view_(render_view),
tracked_frame_(NULL),
progress_(0.0),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
}
LoadProgressTracker::~LoadProgressTracker() {
@@ -28,7 +29,7 @@ void LoadProgressTracker::DidStopLoading() {
if (!tracked_frame_)
return;
- // Load stoped while we were still tracking load. Make sure we notify the
+ // Load stopped while we were still tracking load. Make sure we notify the
// browser that load is complete.
progress_ = 1.0;
SendChangeLoadProgress();
@@ -54,20 +55,20 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
(base::TimeTicks::Now() - last_time_progress_sent_).InMilliseconds() >
kMinimumDelayBetweenUpdatesMS) {
// If there is a pending task to send progress, it is now obsolete.
- method_factory_.RevokeAll();
+ weak_factory_.InvalidateWeakPtrs();
SendChangeLoadProgress();
if (progress == 1.0)
ResetStates();
return;
}
- if (!method_factory_.empty())
+ if (weak_factory_.HasWeakPtrs())
return;
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- method_factory_.NewRunnableMethod(
- &LoadProgressTracker::SendChangeLoadProgress),
+ base::Bind(&LoadProgressTracker::SendChangeLoadProgress,
+ weak_factory_.GetWeakPtr()),
kMinimumDelayBetweenUpdatesMS);
}
@@ -81,6 +82,6 @@ void LoadProgressTracker::SendChangeLoadProgress() {
void LoadProgressTracker::ResetStates() {
tracked_frame_ = NULL;
progress_ = 0.0;
- method_factory_.RevokeAll();
+ weak_factory_.InvalidateWeakPtrs();
last_time_progress_sent_ = base::TimeTicks();
}
diff --git a/content/renderer/load_progress_tracker.h b/content/renderer/load_progress_tracker.h
index 31683c2..f386f91 100644
--- a/content/renderer/load_progress_tracker.h
+++ b/content/renderer/load_progress_tracker.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 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.
@@ -6,7 +6,7 @@
#define CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
#include "base/logging.h"
-#include "base/task.h"
+#include "base/memory/weak_ptr.h"
#include "base/time.h"
class RenderViewImpl;
@@ -37,7 +37,7 @@ class LoadProgressTracker {
base::TimeTicks last_time_progress_sent_;
- ScopedRunnableMethodFactory<LoadProgressTracker> method_factory_;
+ base::WeakPtrFactory<LoadProgressTracker> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker);
};
diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc
index 0c14517..bed04bc 100644
--- a/content/renderer/p2p/ipc_network_manager.cc
+++ b/content/renderer/p2p/ipc_network_manager.cc
@@ -4,6 +4,7 @@
#include "content/renderer/p2p/ipc_network_manager.h"
+#include "base/bind.h"
#include "net/base/net_util.h"
#include "net/base/sys_byteorder.h"
@@ -13,7 +14,7 @@ IpcNetworkManager::IpcNetworkManager(P2PSocketDispatcher* socket_dispatcher)
: socket_dispatcher_(socket_dispatcher),
started_(false),
first_update_sent_(false),
- ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
}
IpcNetworkManager::~IpcNetworkManager() {
@@ -28,8 +29,8 @@ void IpcNetworkManager::StartUpdating() {
} else {
// Post a task to avoid reentrancy.
MessageLoop::current()->PostTask(
- FROM_HERE,task_factory_.NewRunnableMethod(
- &IpcNetworkManager::SendNetworksChangedSignal));
+ FROM_HERE, base::Bind(&IpcNetworkManager::SendNetworksChangedSignal,
+ weak_factory_.GetWeakPtr()));
}
}
diff --git a/content/renderer/p2p/ipc_network_manager.h b/content/renderer/p2p/ipc_network_manager.h
index 83d236a..dd96301 100644
--- a/content/renderer/p2p/ipc_network_manager.h
+++ b/content/renderer/p2p/ipc_network_manager.h
@@ -7,8 +7,8 @@
#include <vector>
-#include "base/task.h"
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "content/renderer/p2p/socket_dispatcher.h"
#include "net/base/net_util.h"
@@ -40,7 +40,7 @@ class IpcNetworkManager : public talk_base::NetworkManagerBase,
bool started_;
bool first_update_sent_;
- ScopedRunnableMethodFactory<IpcNetworkManager> task_factory_;
+ base::WeakPtrFactory<IpcNetworkManager> weak_factory_;
};
} // namespace content
diff --git a/content/renderer/p2p/p2p_transport_impl_unittest.cc b/content/renderer/p2p/p2p_transport_impl_unittest.cc
index 00798de..6dabbc8d 100644
--- a/content/renderer/p2p/p2p_transport_impl_unittest.cc
+++ b/content/renderer/p2p/p2p_transport_impl_unittest.cc
@@ -4,6 +4,7 @@
#include "content/renderer/p2p/p2p_transport_impl.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop.h"
@@ -65,7 +66,7 @@ class UdpChannelTester : public base::RefCountedThreadSafe<UdpChannelTester> {
void Start() {
message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this, &UdpChannelTester::DoStart));
+ FROM_HERE, base::Bind(&UdpChannelTester::DoStart, this));
}
void CheckResults() {
@@ -120,7 +121,7 @@ class UdpChannelTester : public base::RefCountedThreadSafe<UdpChannelTester> {
EXPECT_EQ(kMessageSize, result);
packets_sent_++;
message_loop_->PostDelayedTask(
- FROM_HERE, NewRunnableMethod(this, &UdpChannelTester::DoWrite),
+ FROM_HERE, base::Bind(&UdpChannelTester::DoWrite, this),
kUdpWriteDelayMs);
}
}
@@ -217,12 +218,12 @@ class TcpChannelTester : public base::RefCountedThreadSafe<TcpChannelTester> {
void StartRead() {
message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this, &TcpChannelTester::DoRead));
+ FROM_HERE, base::Bind(&TcpChannelTester::DoRead, this));
}
void StartWrite() {
message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this, &TcpChannelTester::DoWrite));
+ FROM_HERE, base::Bind(&TcpChannelTester::DoWrite, this));
}
void CheckResults() {
@@ -265,7 +266,7 @@ class TcpChannelTester : public base::RefCountedThreadSafe<TcpChannelTester> {
} else if (result > 0) {
send_buffer_->DidConsume(result);
message_loop_->PostDelayedTask(
- FROM_HERE, NewRunnableMethod(this, &TcpChannelTester::DoWrite),
+ FROM_HERE, base::Bind(&TcpChannelTester::DoWrite, this),
kTcpWriteDelayMs);
}
}
diff --git a/content/renderer/p2p/socket_client.cc b/content/renderer/p2p/socket_client.cc
index f31c9cc..899366f 100644
--- a/content/renderer/p2p/socket_client.cc
+++ b/content/renderer/p2p/socket_client.cc
@@ -4,6 +4,7 @@
#include "content/renderer/p2p/socket_client.h"
+#include "base/bind.h"
#include "base/message_loop_proxy.h"
#include "content/common/p2p_messages.h"
#include "content/renderer/p2p/socket_dispatcher.h"
@@ -29,9 +30,8 @@ void P2PSocketClient::Init(
P2PSocketClient::Delegate* delegate) {
if (!ipc_message_loop_->BelongsToCurrentThread()) {
ipc_message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(
- this, &P2PSocketClient::Init, type, local_address,
- remote_address, delegate));
+ FROM_HERE, base::Bind(&P2PSocketClient::Init, this, type, local_address,
+ remote_address, delegate));
return;
}
@@ -47,8 +47,7 @@ void P2PSocketClient::Send(const net::IPEndPoint& address,
const std::vector<char>& data) {
if (!ipc_message_loop_->BelongsToCurrentThread()) {
ipc_message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this, &P2PSocketClient::Send, address,
- data));
+ FROM_HERE, base::Bind(&P2PSocketClient::Send, this, address, data));
return;
}
@@ -66,7 +65,7 @@ void P2PSocketClient::Close() {
delegate_ = NULL;
ipc_message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this, &P2PSocketClient::DoClose));
+ FROM_HERE, base::Bind(&P2PSocketClient::DoClose, this));
}
void P2PSocketClient::DoClose() {
@@ -91,8 +90,9 @@ void P2PSocketClient::OnSocketCreated(const net::IPEndPoint& address) {
DCHECK_EQ(state_, STATE_OPENING);
state_ = STATE_OPEN;
- delegate_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &P2PSocketClient::DeliverOnSocketCreated, address));
+ delegate_message_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&P2PSocketClient::DeliverOnSocketCreated, this, address));
}
void P2PSocketClient::DeliverOnSocketCreated(const net::IPEndPoint& address) {
@@ -112,9 +112,9 @@ void P2PSocketClient::OnIncomingTcpConnection(const net::IPEndPoint& address) {
dispatcher_->SendP2PMessage(new P2PHostMsg_AcceptIncomingTcpConnection(
0, socket_id_, address, new_client->socket_id_));
- delegate_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &P2PSocketClient::DeliverOnIncomingTcpConnection,
- address, new_client));
+ delegate_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&P2PSocketClient::DeliverOnIncomingTcpConnection,
+ this, address, new_client));
}
void P2PSocketClient::DeliverOnIncomingTcpConnection(
@@ -127,8 +127,8 @@ void P2PSocketClient::OnError() {
DCHECK(ipc_message_loop_->BelongsToCurrentThread());
state_ = STATE_ERROR;
- delegate_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &P2PSocketClient::DeliverOnError));
+ delegate_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&P2PSocketClient::DeliverOnError, this));
}
void P2PSocketClient::DeliverOnError() {
@@ -140,8 +140,9 @@ void P2PSocketClient::OnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data) {
DCHECK(ipc_message_loop_->BelongsToCurrentThread());
DCHECK_EQ(STATE_OPEN, state_);
- delegate_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &P2PSocketClient::DeliverOnDataReceived, address, data));
+ delegate_message_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&P2PSocketClient::DeliverOnDataReceived, this, address, data));
}
void P2PSocketClient::DeliverOnDataReceived(const net::IPEndPoint& address,
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 80ea6e2..50ecbff 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include "base/callback.h"
+#include "base/callback_old.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/json/json_value_serializer.h"
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 6b869cf..18f29843 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -4,6 +4,7 @@
#include "content/renderer/render_widget.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
@@ -252,8 +253,8 @@ void RenderWidget::OnClose() {
// If there is a Send call on the stack, then it could be dangerous to close
// now. Post a task that only gets invoked when there are no nested message
// loops.
- MessageLoop::current()->PostNonNestableTask(FROM_HERE,
- NewRunnableMethod(this, &RenderWidget::Close));
+ MessageLoop::current()->PostNonNestableTask(
+ FROM_HERE, NewRunnableMethod(this, &RenderWidget::Close));
// Balances the AddRef taken when we called AddRoute.
Release();
@@ -660,8 +661,9 @@ void RenderWidget::AnimateIfNeeded() {
// Set a timer to call us back after animationInterval before
// running animation callbacks so that if a callback requests another
// we'll be sure to run it at the proper time.
- MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod(
- this, &RenderWidget::AnimationCallback), animationInterval);
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this),
+ animationInterval);
animation_task_posted_ = true;
animation_update_pending_ = false;
webwidget_->animate(0.0);
@@ -680,8 +682,8 @@ void RenderWidget::AnimateIfNeeded() {
// tasks until base::Time::Now() has advanced far enough.
int64 delay = (animation_floor_time_ - now).InMillisecondsRoundedUp();
animation_task_posted_ = true;
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
- NewRunnableMethod(this, &RenderWidget::AnimationCallback), delay);
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), delay);
}
bool RenderWidget::IsRenderingVSynced() {
@@ -898,8 +900,8 @@ void RenderWidget::didInvalidateRect(const WebRect& rect) {
// 2) Allows us to collect more damage rects before painting to help coalesce
// the work that we will need to do.
invalidation_task_posted_ = true;
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &RenderWidget::InvalidationCallback));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this));
}
void RenderWidget::didScrollRect(int dx, int dy, const WebRect& clip_rect) {
@@ -936,8 +938,8 @@ void RenderWidget::didScrollRect(int dx, int dy, const WebRect& clip_rect) {
// 2) Allows us to collect more damage rects before painting to help coalesce
// the work that we will need to do.
invalidation_task_posted_ = true;
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &RenderWidget::InvalidationCallback));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this));
}
void RenderWidget::didActivateCompositor(int compositor_identifier) {
@@ -988,8 +990,8 @@ void RenderWidget::scheduleAnimation() {
animation_update_pending_ = true;
if (!animation_task_posted_) {
animation_task_posted_ = true;
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &RenderWidget::AnimationCallback));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this));
}
}
}
@@ -1047,8 +1049,8 @@ void RenderWidget::closeWidgetSoon() {
// could be closed before the JS finishes executing. So instead, post a
// message back to the message loop, which won't run until the JS is
// complete, and then the Close message can be sent.
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &RenderWidget::DoDeferredClose));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this));
}
void RenderWidget::Close() {