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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 8568030: base::Bind() conversion in renderer_host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing #include for Mac 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/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index f559281510cb48f0c86539fea33f25be607750df..6cf2cf6d413fbb0b24632e4f344b392256e7b7d5 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -6,6 +6,7 @@
#include <QuartzCore/QuartzCore.h>
+#include "base/bind.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
@@ -229,7 +230,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget)
is_loading_(false),
is_hidden_(false),
is_showing_context_menu_(false),
- shutdown_factory_(this),
+ weak_factory_(this),
accelerated_compositing_active_(false),
needs_gpu_visibility_update_after_repaint_(false),
compositing_surface_(gfx::kNullPluginWindow) {
@@ -724,11 +725,11 @@ void RenderWidgetHostViewMac::SetTakesFocusOnlyOnMouseDown(bool flag) {
}
void RenderWidgetHostViewMac::KillSelf() {
- if (shutdown_factory_.empty()) {
+ if (!weak_factory_.HasWeakPtrs()) {
[cocoa_view_ setHidden:YES];
MessageLoop::current()->PostTask(FROM_HERE,
- shutdown_factory_.NewRunnableMethod(
- &RenderWidgetHostViewMac::ShutdownHost));
+ base::Bind(&RenderWidgetHostViewMac::ShutdownHost,
+ weak_factory_.GetWeakPtr()));
}
}
@@ -944,10 +945,9 @@ void RenderWidgetHostViewMac::AcknowledgeSwapBuffers(
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
- NewRunnableFunction(&GpuProcessHostUIShim::SendToGpuHost,
- gpu_host_id,
- new AcceleratedSurfaceMsg_BuffersSwappedACK(
- route_id)));
+ base::Bind(&GpuProcessHostUIShim::SendToGpuHost,
+ gpu_host_id,
+ new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id)));
} else {
GpuProcessHost::SendOnIO(
gpu_host_id,
@@ -1069,7 +1069,7 @@ void RenderWidgetHostViewMac::UnlockMouse() {
}
void RenderWidgetHostViewMac::ShutdownHost() {
- shutdown_factory_.RevokeAll();
+ weak_factory_.InvalidateWeakPtrs();
render_widget_host_->Shutdown();
// Do not touch any members at this point, |this| has been deleted.
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698