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

Unified Diff: webkit/plugins/npapi/webplugin_impl.cc

Issue 8539023: base::Bind: Conversions in webkit/plugins/npapi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « webkit/plugins/npapi/webplugin_impl.h ('k') | webkit/plugins/ppapi/ppb_surface_3d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/webplugin_impl.cc
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index 02038724d6dcb3457bdf0e38f47d47b23f672949..b78aeaba4a15d219d95e5491c9c1f2b95f6ef278 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -4,6 +4,7 @@
#include "webkit/plugins/npapi/webplugin_impl.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/linked_ptr.h"
#include "base/message_loop.h"
@@ -347,9 +348,9 @@ void WebPluginImpl::updateGeometry(
// geometry received by a call to setFrameRect in the Webkit
// layout code path. To workaround this issue we download the
// plugin source url on a timer.
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE, method_factory_.NewRunnableMethod(
- &WebPluginImpl::OnDownloadPluginSrcUrl), 0);
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&WebPluginImpl::OnDownloadPluginSrcUrl,
+ weak_factory_.GetWeakPtr()));
}
}
@@ -474,7 +475,7 @@ WebPluginImpl::WebPluginImpl(
ignore_response_error_(false),
file_path_(file_path),
mime_type_(UTF16ToASCII(params.mimeType)),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
DCHECK_EQ(params.attributeNames.size(), params.attributeValues.size());
StringToLowerASCII(&mime_type_);
@@ -1350,7 +1351,7 @@ void WebPluginImpl::TearDownPluginInstance(
// This needs to be called now and not in the destructor since the
// webframe_ might not be valid anymore.
webframe_ = NULL;
- method_factory_.RevokeAll();
+ weak_factory_.InvalidateWeakPtrs();
}
void WebPluginImpl::SetReferrer(WebKit::WebURLRequest* request,
« no previous file with comments | « webkit/plugins/npapi/webplugin_impl.h ('k') | webkit/plugins/ppapi/ppb_surface_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698