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

Unified Diff: content/plugin/webplugin_delegate_stub.cc

Issue 8733013: base::Bind fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issues 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/webplugin_delegate_stub.cc
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index cf6d26321d946a52778162c0527e4e7e9b259e03..e68541667fa40bd13584d7e5d0f2b43a79ea12e7 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -6,6 +6,7 @@
#include "build/build_config.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/string_number_conversions.h"
#include "content/common/npobject_stub.h"
@@ -29,25 +30,14 @@ using WebKit::WebCursorInfo;
using webkit::npapi::WebPlugin;
using webkit::npapi::WebPluginResourceClient;
-class FinishDestructionTask : public Task {
- public:
- FinishDestructionTask(webkit::npapi::WebPluginDelegateImpl* delegate,
- WebPlugin* webplugin)
- : delegate_(delegate), webplugin_(webplugin) {
- }
-
- void Run() {
- // WebPlugin must outlive WebPluginDelegate.
- if (delegate_)
- delegate_->PluginDestroyed();
+void FinishDestructionCallback(webkit::npapi::WebPluginDelegateImpl* delegate,
+ WebPlugin* webplugin) {
+ // WebPlugin must outlive WebPluginDelegate.
+ if (delegate)
+ delegate->PluginDestroyed();
- delete webplugin_;
- }
-
- private:
- webkit::npapi::WebPluginDelegateImpl* delegate_;
- webkit::npapi::WebPlugin* webplugin_;
-};
+ delete webplugin;
+}
WebPluginDelegateStub::WebPluginDelegateStub(
const std::string& mime_type, int instance_id, PluginChannel* channel) :
@@ -68,7 +58,7 @@ WebPluginDelegateStub::~WebPluginDelegateStub() {
// The delegate or an npobject is in the callstack, so don't delete it
// right away.
MessageLoop::current()->PostNonNestableTask(FROM_HERE,
- new FinishDestructionTask(delegate_, webplugin_));
+ base::Bind(&FinishDestructionCallback, delegate_, webplugin_));
} else {
// Safe to delete right away.
if (delegate_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698