OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/plugin/plugin_channel.h" | 5 #include "content/plugin/plugin_channel.h" |
6 | 6 |
| 7 #include "base/bind.h" |
7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
8 #include "base/process_util.h" | 9 #include "base/process_util.h" |
9 #include "base/string_util.h" | 10 #include "base/string_util.h" |
10 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
11 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "content/common/child_process.h" | 14 #include "content/common/child_process.h" |
14 #include "content/common/plugin_messages.h" | 15 #include "content/common/plugin_messages.h" |
15 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
16 #include "content/plugin/plugin_thread.h" | 17 #include "content/plugin/plugin_thread.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 scoped_refptr<MessageFilter> filter(filter_); | 232 scoped_refptr<MessageFilter> filter(filter_); |
232 gfx::NativeViewId window = | 233 gfx::NativeViewId window = |
233 plugin_stubs_[i]->webplugin()->containing_window(); | 234 plugin_stubs_[i]->webplugin()->containing_window(); |
234 plugin_stubs_.erase(plugin_stubs_.begin() + i); | 235 plugin_stubs_.erase(plugin_stubs_.begin() + i); |
235 Send(reply_msg); | 236 Send(reply_msg); |
236 RemoveRoute(instance_id); | 237 RemoveRoute(instance_id); |
237 // NOTE: *this* might be deleted as a result of calling RemoveRoute. | 238 // NOTE: *this* might be deleted as a result of calling RemoveRoute. |
238 // Don't release the modal dialog event right away, but do it after the | 239 // Don't release the modal dialog event right away, but do it after the |
239 // stack unwinds since the plugin can be destroyed later if it's in use | 240 // stack unwinds since the plugin can be destroyed later if it's in use |
240 // right now. | 241 // right now. |
241 MessageLoop::current()->PostNonNestableTask(FROM_HERE, NewRunnableMethod( | 242 MessageLoop::current()->PostNonNestableTask(FROM_HERE, base::Bind( |
242 filter.get(), &MessageFilter::ReleaseModalDialogEvent, window)); | 243 &MessageFilter::ReleaseModalDialogEvent, filter.get(), window)); |
243 return; | 244 return; |
244 } | 245 } |
245 } | 246 } |
246 | 247 |
247 NOTREACHED() << "Couldn't find WebPluginDelegateStub to destroy"; | 248 NOTREACHED() << "Couldn't find WebPluginDelegateStub to destroy"; |
248 } | 249 } |
249 | 250 |
250 void PluginChannel::OnGenerateRouteID(int* route_id) { | 251 void PluginChannel::OnGenerateRouteID(int* route_id) { |
251 *route_id = GenerateRouteID(); | 252 *route_id = GenerateRouteID(); |
252 } | 253 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 bool PluginChannel::Init(base::MessageLoopProxy* ipc_message_loop, | 328 bool PluginChannel::Init(base::MessageLoopProxy* ipc_message_loop, |
328 bool create_pipe_now, | 329 bool create_pipe_now, |
329 base::WaitableEvent* shutdown_event) { | 330 base::WaitableEvent* shutdown_event) { |
330 if (!NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event)) | 331 if (!NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event)) |
331 return false; | 332 return false; |
332 | 333 |
333 channel_->AddFilter(filter_.get()); | 334 channel_->AddFilter(filter_.get()); |
334 return true; | 335 return true; |
335 } | 336 } |
336 | 337 |
OLD | NEW |