| 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_)
|
|
|