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 <fcntl.h> | 8 #include <fcntl.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 | 297 |
298 #if defined(ENABLE_PLUGINS) | 298 #if defined(ENABLE_PLUGINS) |
299 // Loads the (native) libraries but does not initialize them (i.e., does not | 299 // Loads the (native) libraries but does not initialize them (i.e., does not |
300 // call PPP_InitializeModule). This is needed by the zygote on Linux to get | 300 // call PPP_InitializeModule). This is needed by the zygote on Linux to get |
301 // access to the plugins before entering the sandbox. | 301 // access to the plugins before entering the sandbox. |
302 void PreloadPepperPlugins() { | 302 void PreloadPepperPlugins() { |
303 std::vector<PepperPluginInfo> plugins; | 303 std::vector<PepperPluginInfo> plugins; |
304 ComputePepperPluginList(&plugins); | 304 ComputePepperPluginList(&plugins); |
305 for (size_t i = 0; i < plugins.size(); ++i) { | 305 for (size_t i = 0; i < plugins.size(); ++i) { |
306 if (!plugins[i].is_internal && plugins[i].is_sandboxed) { | 306 if (!plugins[i].is_internal) { |
307 base::NativeLibraryLoadError error; | 307 base::NativeLibraryLoadError error; |
308 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, | 308 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, |
309 &error); | 309 &error); |
310 VLOG_IF(1, !library) << "Unable to load plugin " | 310 VLOG_IF(1, !library) << "Unable to load plugin " |
311 << plugins[i].path.value() << " " | 311 << plugins[i].path.value() << " " |
312 << error.ToString(); | 312 << error.ToString(); |
313 | 313 |
314 (void)library; // Prevent release-mode warning. | 314 (void)library; // Prevent release-mode warning. |
315 } | 315 } |
316 } | 316 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; | 596 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; |
597 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); | 597 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); |
598 | 598 |
599 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, | 599 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, |
600 extra_fds); | 600 extra_fds); |
601 // This function call can return multiple times, once per fork(). | 601 // This function call can return multiple times, once per fork(). |
602 return zygote.ProcessRequests(); | 602 return zygote.ProcessRequests(); |
603 } | 603 } |
604 | 604 |
605 } // namespace content | 605 } // namespace content |
OLD | NEW |