| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/pepper/plugin_module.h" | 5 #include "content/renderer/pepper/plugin_module.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 // In-process plugin not preloaded, it probably couldn't be initialized. | 794 // In-process plugin not preloaded, it probably couldn't be initialized. |
| 795 return scoped_refptr<PluginModule>(); | 795 return scoped_refptr<PluginModule>(); |
| 796 } | 796 } |
| 797 | 797 |
| 798 // Out of process: have the browser start the plugin process for us. | 798 // Out of process: have the browser start the plugin process for us. |
| 799 IPC::ChannelHandle channel_handle; | 799 IPC::ChannelHandle channel_handle; |
| 800 base::ProcessId peer_pid = 0; | 800 base::ProcessId peer_pid = 0; |
| 801 int plugin_child_id = 0; | 801 int plugin_child_id = 0; |
| 802 render_frame->Send(new FrameHostMsg_OpenChannelToPepperPlugin( | 802 render_frame->Send(new FrameHostMsg_OpenChannelToPepperPlugin( |
| 803 path, &channel_handle, &peer_pid, &plugin_child_id)); | 803 path, &channel_handle, &peer_pid, &plugin_child_id)); |
| 804 if (channel_handle.name.empty()) { | 804 if (!channel_handle.is_mojo_channel_handle()) { |
| 805 // Couldn't be initialized. | 805 // Couldn't be initialized. |
| 806 return scoped_refptr<PluginModule>(); | 806 return scoped_refptr<PluginModule>(); |
| 807 } | 807 } |
| 808 | 808 |
| 809 ppapi::PpapiPermissions permissions(info->permissions); | 809 ppapi::PpapiPermissions permissions(info->permissions); |
| 810 | 810 |
| 811 // AddLiveModule must be called before any early returns since the | 811 // AddLiveModule must be called before any early returns since the |
| 812 // module's destructor will remove itself. | 812 // module's destructor will remove itself. |
| 813 module = new PluginModule(info->name, info->version, path, permissions); | 813 module = new PluginModule(info->name, info->version, path, permissions); |
| 814 PepperPluginRegistry::GetInstance()->AddLiveModule(path, module.get()); | 814 PepperPluginRegistry::GetInstance()->AddLiveModule(path, module.get()); |
| 815 | 815 |
| 816 if (!module->CreateOutOfProcessModule(render_frame, | 816 if (!module->CreateOutOfProcessModule(render_frame, |
| 817 path, | 817 path, |
| 818 permissions, | 818 permissions, |
| 819 channel_handle, | 819 channel_handle, |
| 820 peer_pid, | 820 peer_pid, |
| 821 plugin_child_id, | 821 plugin_child_id, |
| 822 false)) // is_external = false | 822 false)) // is_external = false |
| 823 return scoped_refptr<PluginModule>(); | 823 return scoped_refptr<PluginModule>(); |
| 824 | 824 |
| 825 return module; | 825 return module; |
| 826 } | 826 } |
| 827 | 827 |
| 828 } // namespace content | 828 } // namespace content |
| OLD | NEW |