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

Unified Diff: webkit/plugins/ppapi/ppb_scrollbar_impl.cc

Issue 7640001: Fix crash with print preview and the new scrollbar code that triggered an assert in WebKit side. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months 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 | « webkit/plugins/ppapi/ppb_scrollbar_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_scrollbar_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_scrollbar_impl.cc (revision 96306)
+++ webkit/plugins/ppapi/ppb_scrollbar_impl.cc (working copy)
@@ -117,7 +117,8 @@
}
PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PluginInstance* instance)
- : PPB_Widget_Impl(instance) {
+ : PPB_Widget_Impl(instance),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
}
PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() {
@@ -282,9 +283,13 @@
// Can't call into the client to tell them about the invalidate right away,
// since the PPB_Scrollbar_Impl code is still in the middle of updating its
// internal state.
+ // Note: we use a method factory here instead of NewRunnableMethod because the
+ // latter would modify the lifetime of this object. That might make
+ // WebKit::WebScrollbar outlive WebKit::WebPluginContainer, which is against
+ // its contract.
MessageLoop::current()->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &PPB_Scrollbar_Impl::NotifyInvalidate));
+ method_factory_.NewRunnableMethod(&PPB_Scrollbar_Impl::NotifyInvalidate));
}
void PPB_Scrollbar_Impl::getTickmarks(
« no previous file with comments | « webkit/plugins/ppapi/ppb_scrollbar_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698