| Index: content/plugin/plugin_channel.cc
|
| ===================================================================
|
| --- content/plugin/plugin_channel.cc (revision 129628)
|
| +++ content/plugin/plugin_channel.cc (working copy)
|
| @@ -161,7 +161,8 @@
|
| }
|
|
|
| PluginChannel::PluginChannel()
|
| - : renderer_id_(-1),
|
| + : renderer_handle_(0),
|
| + renderer_id_(-1),
|
| in_send_(0),
|
| incognito_(false),
|
| filter_(new MessageFilter()) {
|
| @@ -172,6 +173,9 @@
|
| }
|
|
|
| PluginChannel::~PluginChannel() {
|
| + if (renderer_handle_)
|
| + base::CloseProcessHandle(renderer_handle_);
|
| +
|
| MessageLoop::current()->PostDelayedTask(
|
| FROM_HERE,
|
| base::Bind(&PluginReleaseCallback),
|
| @@ -288,7 +292,18 @@
|
| return filter_->GetModalDialogEvent(containing_window);
|
| }
|
|
|
| +void PluginChannel::OnChannelConnected(int32 peer_pid) {
|
| + base::ProcessHandle handle;
|
| + if (!base::OpenProcessHandle(peer_pid, &handle)) {
|
| + NOTREACHED();
|
| + }
|
| + renderer_handle_ = handle;
|
| + NPChannelBase::OnChannelConnected(peer_pid);
|
| +}
|
| +
|
| void PluginChannel::OnChannelError() {
|
| + base::CloseProcessHandle(renderer_handle_);
|
| + renderer_handle_ = 0;
|
| NPChannelBase::OnChannelError();
|
| CleanUp();
|
| }
|
|
|