summaryrefslogtreecommitdiffstats
path: root/content/plugin
diff options
context:
space:
mode:
authorgroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-02 21:42:10 +0000
committergroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-02 21:42:10 +0000
commitf03f423a9ce11b1f78e92ed5fa0999723f1e6e2b (patch)
treeddc87c69386471dcc2d08903bb0dfa7576fa669b /content/plugin
parent33c86b8f4aedfc1708c5d243ae1599b42166f0e1 (diff)
downloadchromium_src-f03f423a9ce11b1f78e92ed5fa0999723f1e6e2b.zip
chromium_src-f03f423a9ce11b1f78e92ed5fa0999723f1e6e2b.tar.gz
chromium_src-f03f423a9ce11b1f78e92ed5fa0999723f1e6e2b.tar.bz2
base::Bind fixes
R=jhawkins@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/8733013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r--content/plugin/webplugin_delegate_stub.cc28
1 files changed, 9 insertions, 19 deletions
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index cf6d263..e685416 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_)