| 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/zygote/zygote_main.h" | 5 #include "content/zygote/zygote_main.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // call PPP_InitializeModule). This is needed by the zygote on Linux to get | 255 // call PPP_InitializeModule). This is needed by the zygote on Linux to get |
| 256 // access to the plugins before entering the sandbox. | 256 // access to the plugins before entering the sandbox. |
| 257 void PreloadPepperPlugins() { | 257 void PreloadPepperPlugins() { |
| 258 std::vector<PepperPluginInfo> plugins; | 258 std::vector<PepperPluginInfo> plugins; |
| 259 ComputePepperPluginList(&plugins); | 259 ComputePepperPluginList(&plugins); |
| 260 for (size_t i = 0; i < plugins.size(); ++i) { | 260 for (size_t i = 0; i < plugins.size(); ++i) { |
| 261 if (!plugins[i].is_internal && plugins[i].is_sandboxed) { | 261 if (!plugins[i].is_internal && plugins[i].is_sandboxed) { |
| 262 std::string error; | 262 std::string error; |
| 263 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, | 263 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, |
| 264 &error); | 264 &error); |
| 265 DLOG_IF(WARNING, !library) << "Unable to load plugin " | 265 VLOG_IF(1, !library) << "Unable to load plugin " |
| 266 << plugins[i].path.value() << " " | 266 << plugins[i].path.value() << " " |
| 267 << error; | 267 << error; |
| 268 |
| 268 (void)library; // Prevent release-mode warning. | 269 (void)library; // Prevent release-mode warning. |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 } | 272 } |
| 272 #endif | 273 #endif |
| 273 | 274 |
| 274 // This function triggers the static and lazy construction of objects that need | 275 // This function triggers the static and lazy construction of objects that need |
| 275 // to be created before imposing the sandbox. | 276 // to be created before imposing the sandbox. |
| 276 static void PreSandboxInit() { | 277 static void PreSandboxInit() { |
| 277 base::RandUint64(); | 278 base::RandUint64(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 435 } |
| 435 | 436 |
| 436 int sandbox_flags = linux_sandbox->GetStatus(); | 437 int sandbox_flags = linux_sandbox->GetStatus(); |
| 437 | 438 |
| 438 Zygote zygote(sandbox_flags, forkdelegate); | 439 Zygote zygote(sandbox_flags, forkdelegate); |
| 439 // This function call can return multiple times, once per fork(). | 440 // This function call can return multiple times, once per fork(). |
| 440 return zygote.ProcessRequests(); | 441 return zygote.ProcessRequests(); |
| 441 } | 442 } |
| 442 | 443 |
| 443 } // namespace content | 444 } // namespace content |
| OLD | NEW |