| 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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "content/common/child_process.h" | 13 #include "content/common/child_process.h" |
| 14 #include "content/common/content_switches.h" | 14 #include "content/common/content_switches.h" |
| 15 #include "content/common/sandbox_init_wrapper.h" | 15 #include "content/common/sandbox_init_wrapper.h" |
| 16 #include "content/ppapi_plugin/broker_process_dispatcher.h" | 16 #include "content/ppapi_plugin/broker_process_dispatcher.h" |
| 17 #include "content/ppapi_plugin/plugin_process_dispatcher.h" | 17 #include "content/ppapi_plugin/plugin_process_dispatcher.h" |
| 18 #include "content/ppapi_plugin/ppapi_webkit_thread.h" | 18 #include "content/ppapi_plugin/ppapi_webkit_thread.h" |
| 19 #include "ipc/ipc_channel_handle.h" | 19 #include "ipc/ipc_channel_handle.h" |
| 20 #include "ipc/ipc_sync_channel.h" | 20 #include "ipc/ipc_sync_channel.h" |
| 21 #include "ppapi/c/dev/ppp_network_state_dev.h" | 21 #include "ppapi/c/dev/ppp_network_state_dev.h" |
| 22 #include "ppapi/c/pp_errors.h" | 22 #include "ppapi/c/pp_errors.h" |
| 23 #include "ppapi/c/ppp.h" | 23 #include "ppapi/c/ppp.h" |
| 24 #include "ppapi/proxy/ppapi_messages.h" | 24 #include "ppapi/proxy/ppapi_messages.h" |
| 25 #include "ppapi/proxy/interface_list.h" | |
| 26 #include "webkit/plugins/ppapi/webkit_forwarding_impl.h" | 25 #include "webkit/plugins/ppapi/webkit_forwarding_impl.h" |
| 27 | 26 |
| 28 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 29 #include "sandbox/src/sandbox.h" | 28 #include "sandbox/src/sandbox.h" |
| 30 #endif | 29 #endif |
| 31 | 30 |
| 32 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 33 extern sandbox::TargetServices* g_target_services; | 32 extern sandbox::TargetServices* g_target_services; |
| 34 #else | 33 #else |
| 35 extern void* g_target_services; | 34 extern void* g_target_services; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Get the InitializeModule function (required). | 202 // Get the InitializeModule function (required). |
| 204 ppapi::proxy::Dispatcher::InitModuleFunc init_module = | 203 ppapi::proxy::Dispatcher::InitModuleFunc init_module = |
| 205 reinterpret_cast<ppapi::proxy::Dispatcher::InitModuleFunc>( | 204 reinterpret_cast<ppapi::proxy::Dispatcher::InitModuleFunc>( |
| 206 library.GetFunctionPointer("PPP_InitializeModule")); | 205 library.GetFunctionPointer("PPP_InitializeModule")); |
| 207 if (!init_module) { | 206 if (!init_module) { |
| 208 LOG(WARNING) << "No PPP_InitializeModule in plugin library"; | 207 LOG(WARNING) << "No PPP_InitializeModule in plugin library"; |
| 209 return; | 208 return; |
| 210 } | 209 } |
| 211 int32_t init_error = init_module( | 210 int32_t init_error = init_module( |
| 212 local_pp_module_, | 211 local_pp_module_, |
| 213 &ppapi::proxy::PluginDispatcher::GetBrowserInterface); | 212 &ppapi::proxy::PluginDispatcher::GetInterfaceFromDispatcher); |
| 214 if (init_error != PP_OK) { | 213 if (init_error != PP_OK) { |
| 215 LOG(WARNING) << "InitModule failed with error " << init_error; | 214 LOG(WARNING) << "InitModule failed with error " << init_error; |
| 216 return; | 215 return; |
| 217 } | 216 } |
| 218 } | 217 } |
| 219 | 218 |
| 220 library_.Reset(library.Release()); | 219 library_.Reset(library.Release()); |
| 221 } | 220 } |
| 222 | 221 |
| 223 void PpapiThread::OnMsgCreateChannel(base::ProcessHandle host_process_handle, | 222 void PpapiThread::OnMsgCreateChannel(base::ProcessHandle host_process_handle, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 #if defined(OS_POSIX) | 292 #if defined(OS_POSIX) |
| 294 // On POSIX, pass the renderer-side FD. | 293 // On POSIX, pass the renderer-side FD. |
| 295 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), | 294 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), |
| 296 true); | 295 true); |
| 297 #endif | 296 #endif |
| 298 | 297 |
| 299 // From here, the dispatcher will manage its own lifetime according to the | 298 // From here, the dispatcher will manage its own lifetime according to the |
| 300 // lifetime of the attached channel. | 299 // lifetime of the attached channel. |
| 301 return true; | 300 return true; |
| 302 } | 301 } |
| OLD | NEW |