Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: content/renderer/render_widget.cc

Issue 8554001: base::Bind: Convert content/renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fix. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 6b869cf7435880f4ae15f3078895a403a067943b..18f29843dff9b4f131d070a9e9454416f21ec95a 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() {
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698