| 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/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return false; | 126 return false; |
| 127 | 127 |
| 128 #if defined(OS_POSIX) | 128 #if defined(OS_POSIX) |
| 129 DCHECK_NE(-1, channel_handle.socket.fd); | 129 DCHECK_NE(-1, channel_handle.socket.fd); |
| 130 if (channel_handle.socket.fd == -1) | 130 if (channel_handle.socket.fd == -1) |
| 131 return false; | 131 return false; |
| 132 #endif | 132 #endif |
| 133 | 133 |
| 134 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); | 134 dispatcher_delegate_.reset(new PepperProxyChannelDelegateImpl); |
| 135 dispatcher_.reset(new ppapi::proxy::HostDispatcher( | 135 dispatcher_.reset(new ppapi::proxy::HostDispatcher( |
| 136 module_->pp_module(), local_get_interface, filter)); | 136 module_->pp_module(), local_get_interface, filter, permissions_)); |
| 137 | 137 |
| 138 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), | 138 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), |
| 139 channel_handle, | 139 channel_handle, |
| 140 true, // Client. | 140 true, // Client. |
| 141 preferences)) { | 141 preferences)) { |
| 142 dispatcher_.reset(); | 142 dispatcher_.reset(); |
| 143 dispatcher_delegate_.reset(); | 143 dispatcher_delegate_.reset(); |
| 144 return false; | 144 return false; |
| 145 } | 145 } |
| 146 dispatcher_->channel()->SetRestrictDispatchChannelGroup( | 146 dispatcher_->channel()->SetRestrictDispatchChannelGroup( |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // be out of process. | 362 // be out of process. |
| 363 const PepperPluginInfo* info = | 363 const PepperPluginInfo* info = |
| 364 PepperPluginRegistry::GetInstance()->GetInfoForPlugin(webplugin_info); | 364 PepperPluginRegistry::GetInstance()->GetInfoForPlugin(webplugin_info); |
| 365 if (!info) { | 365 if (!info) { |
| 366 *pepper_plugin_was_registered = false; | 366 *pepper_plugin_was_registered = false; |
| 367 return scoped_refptr<webkit::ppapi::PluginModule>(); | 367 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 368 } else if (!info->is_out_of_process) { | 368 } else if (!info->is_out_of_process) { |
| 369 // In-process plugin not preloaded, it probably couldn't be initialized. | 369 // In-process plugin not preloaded, it probably couldn't be initialized. |
| 370 return scoped_refptr<webkit::ppapi::PluginModule>(); | 370 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 371 } | 371 } |
| 372 ppapi::PpapiPermissions permissions(info->permissions); | 372 |
| 373 ppapi::PpapiPermissions permissions = |
| 374 ppapi::PpapiPermissions::GetForCommandLine(info->permissions); |
| 373 | 375 |
| 374 // Out of process: have the browser start the plugin process for us. | 376 // Out of process: have the browser start the plugin process for us. |
| 375 IPC::ChannelHandle channel_handle; | 377 IPC::ChannelHandle channel_handle; |
| 376 int plugin_child_id = 0; | 378 int plugin_child_id = 0; |
| 377 render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin( | 379 render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin( |
| 378 path, &channel_handle, &plugin_child_id)); | 380 path, &channel_handle, &plugin_child_id)); |
| 379 if (channel_handle.name.empty()) { | 381 if (channel_handle.name.empty()) { |
| 380 // Couldn't be initialized. | 382 // Couldn't be initialized. |
| 381 return scoped_refptr<webkit::ppapi::PluginModule>(); | 383 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 382 } | 384 } |
| (...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 else | 1874 else |
| 1873 return render_view_->mouse_lock_dispatcher(); | 1875 return render_view_->mouse_lock_dispatcher(); |
| 1874 } | 1876 } |
| 1875 | 1877 |
| 1876 webkit_glue::ClipboardClient* | 1878 webkit_glue::ClipboardClient* |
| 1877 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1879 PepperPluginDelegateImpl::CreateClipboardClient() const { |
| 1878 return new RendererClipboardClient; | 1880 return new RendererClipboardClient; |
| 1879 } | 1881 } |
| 1880 | 1882 |
| 1881 } // namespace content | 1883 } // namespace content |
| OLD | NEW |