| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_module.h" | 5 #include "webkit/glue/plugins/pepper_plugin_module.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 bool PluginModule::InitForOutOfProcess(MessageLoop* ipc_message_loop, | 409 bool PluginModule::InitForOutOfProcess(MessageLoop* ipc_message_loop, |
| 410 base::ProcessHandle remote_process, | 410 base::ProcessHandle remote_process, |
| 411 const IPC::ChannelHandle& handle, | 411 const IPC::ChannelHandle& handle, |
| 412 base::WaitableEvent* shutdown_event) { | 412 base::WaitableEvent* shutdown_event) { |
| 413 const PPB_Var_Deprecated* var_interface = | 413 const PPB_Var_Deprecated* var_interface = |
| 414 reinterpret_cast<const PPB_Var_Deprecated*>( | 414 reinterpret_cast<const PPB_Var_Deprecated*>( |
| 415 GetInterface(PPB_VAR_DEPRECATED_INTERFACE)); | 415 GetInterface(PPB_VAR_DEPRECATED_INTERFACE)); |
| 416 dispatcher_.reset(new pp::proxy::HostDispatcher( | 416 dispatcher_.reset(new pp::proxy::HostDispatcher( |
| 417 remote_process, var_interface, pp_module(), &GetInterface)); | 417 remote_process, var_interface, pp_module(), &GetInterface)); |
| 418 | 418 |
| 419 #if defined(OS_POSIX) | 419 if (!dispatcher_->InitWithChannel(ipc_message_loop, handle, true, |
| 420 // If we received a ChannelHandle, register it now. | |
| 421 if (handle.socket.fd >= 0) | |
| 422 IPC::AddChannelSocket(handle.name, handle.socket.fd); | |
| 423 #endif | |
| 424 | |
| 425 if (!dispatcher_->InitWithChannel(ipc_message_loop, handle.name, true, | |
| 426 shutdown_event)) { | 420 shutdown_event)) { |
| 427 dispatcher_.reset(); | 421 dispatcher_.reset(); |
| 428 return false; | 422 return false; |
| 429 } | 423 } |
| 430 | 424 |
| 431 bool init_result = false; | 425 bool init_result = false; |
| 432 dispatcher_->Send(new PpapiMsg_InitializeModule(pp_module(), &init_result)); | 426 dispatcher_->Send(new PpapiMsg_InitializeModule(pp_module(), &init_result)); |
| 433 if (!init_result) { | 427 if (!init_result) { |
| 434 // TODO(brettw) does the module get unloaded in this case? | 428 // TODO(brettw) does the module get unloaded in this case? |
| 435 dispatcher_.reset(); | 429 dispatcher_.reset(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 live_plugin_objects_.insert(plugin_object); | 540 live_plugin_objects_.insert(plugin_object); |
| 547 } | 541 } |
| 548 | 542 |
| 549 void PluginModule::RemovePluginObject(PluginObject* plugin_object) { | 543 void PluginModule::RemovePluginObject(PluginObject* plugin_object) { |
| 550 // Don't actually verify that the object is in the set since during module | 544 // Don't actually verify that the object is in the set since during module |
| 551 // deletion we'll be in the process of freeing them. | 545 // deletion we'll be in the process of freeing them. |
| 552 live_plugin_objects_.erase(plugin_object); | 546 live_plugin_objects_.erase(plugin_object); |
| 553 } | 547 } |
| 554 | 548 |
| 555 } // namespace pepper | 549 } // namespace pepper |
| OLD | NEW |