| 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" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 library.GetFunctionPointer("PPP_GetInterface")); | 194 library.GetFunctionPointer("PPP_GetInterface")); |
| 195 if (!get_plugin_interface_) { | 195 if (!get_plugin_interface_) { |
| 196 LOG(WARNING) << "No PPP_GetInterface in plugin library"; | 196 LOG(WARNING) << "No PPP_GetInterface in plugin library"; |
| 197 return; | 197 return; |
| 198 } | 198 } |
| 199 | 199 |
| 200 #if defined(OS_MACOSX) | 200 #if defined(OS_MACOSX) |
| 201 // We need to do this after getting |PPP_GetInterface()| (or presumably | 201 // We need to do this after getting |PPP_GetInterface()| (or presumably |
| 202 // doing something nontrivial with the library), else the sandbox | 202 // doing something nontrivial with the library), else the sandbox |
| 203 // intercedes. | 203 // intercedes. |
| 204 if (!content::InitializeSandbox()) { | 204 if (!content::InitializeSandboxFromProcessType()) { |
| 205 LOG(WARNING) << "Failed to initialize sandbox"; | 205 LOG(WARNING) << "Failed to initialize sandbox"; |
| 206 } | 206 } |
| 207 #endif | 207 #endif |
| 208 | 208 |
| 209 // Get the InitializeModule function (required). | 209 // Get the InitializeModule function (required). |
| 210 ppapi::proxy::Dispatcher::InitModuleFunc init_module = | 210 ppapi::proxy::Dispatcher::InitModuleFunc init_module = |
| 211 reinterpret_cast<ppapi::proxy::Dispatcher::InitModuleFunc>( | 211 reinterpret_cast<ppapi::proxy::Dispatcher::InitModuleFunc>( |
| 212 library.GetFunctionPointer("PPP_InitializeModule")); | 212 library.GetFunctionPointer("PPP_InitializeModule")); |
| 213 if (!init_module) { | 213 if (!init_module) { |
| 214 LOG(WARNING) << "No PPP_InitializeModule in plugin library"; | 214 LOG(WARNING) << "No PPP_InitializeModule in plugin library"; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // connection is not established. | 302 // connection is not established. |
| 303 handle->socket = base::FileDescriptor(dispatcher->TakeRendererFD(), true); | 303 handle->socket = base::FileDescriptor(dispatcher->TakeRendererFD(), true); |
| 304 if (handle->socket.fd == -1) | 304 if (handle->socket.fd == -1) |
| 305 return false; | 305 return false; |
| 306 #endif | 306 #endif |
| 307 | 307 |
| 308 // From here, the dispatcher will manage its own lifetime according to the | 308 // From here, the dispatcher will manage its own lifetime according to the |
| 309 // lifetime of the attached channel. | 309 // lifetime of the attached channel. |
| 310 return true; | 310 return true; |
| 311 } | 311 } |
| OLD | NEW |