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/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include <dbus/dbus-glib.h> | 61 #include <dbus/dbus-glib.h> |
62 #endif | 62 #endif |
63 | 63 |
64 #if defined(TOOLKIT_USES_GTK) | 64 #if defined(TOOLKIT_USES_GTK) |
65 #include "ui/gfx/gtk_util.h" | 65 #include "ui/gfx/gtk_util.h" |
66 #endif | 66 #endif |
67 | 67 |
68 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 68 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
69 #include <sys/stat.h> | 69 #include <sys/stat.h> |
70 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 70 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
71 #include "content/browser/zygote_host_linux.h" | 71 #include "content/browser/zygote_host_impl_linux.h" |
72 #endif | 72 #endif |
73 | 73 |
74 #if defined(USE_X11) | 74 #if defined(USE_X11) |
75 #include <X11/Xlib.h> | 75 #include <X11/Xlib.h> |
76 #endif | 76 #endif |
77 | 77 |
78 // One of the linux specific headers defines this as a macro. | 78 // One of the linux specific headers defines this as a macro. |
79 #ifdef DestroyAll | 79 #ifdef DestroyAll |
80 #undef DestroyAll | 80 #undef DestroyAll |
81 #endif | 81 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
98 #if defined(LINUX_SANDBOX_PATH) | 98 #if defined(LINUX_SANDBOX_PATH) |
99 if (!sandbox_binary) | 99 if (!sandbox_binary) |
100 sandbox_binary = LINUX_SANDBOX_PATH; | 100 sandbox_binary = LINUX_SANDBOX_PATH; |
101 #endif | 101 #endif |
102 | 102 |
103 std::string sandbox_cmd; | 103 std::string sandbox_cmd; |
104 if (sandbox_binary && !parsed_command_line.HasSwitch(switches::kNoSandbox)) | 104 if (sandbox_binary && !parsed_command_line.HasSwitch(switches::kNoSandbox)) |
105 sandbox_cmd = sandbox_binary; | 105 sandbox_cmd = sandbox_binary; |
106 | 106 |
107 // Tickle the sandbox host and zygote host so they fork now. | 107 // Tickle the sandbox host and zygote host so they fork now. |
108 RenderSandboxHostLinux* shost = RenderSandboxHostLinux::GetInstance(); | 108 RenderSandboxHostLinux::GetInstance()->Init(sandbox_cmd); |
109 shost->Init(sandbox_cmd); | 109 ZygoteHostImpl::GetInstance()->Init(sandbox_cmd); |
110 ZygoteHost* zhost = ZygoteHost::GetInstance(); | |
111 zhost->Init(sandbox_cmd); | |
112 } | 110 } |
113 #endif | 111 #endif |
114 | 112 |
115 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 113 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
116 static void GLibLogHandler(const gchar* log_domain, | 114 static void GLibLogHandler(const gchar* log_domain, |
117 GLogLevelFlags log_level, | 115 GLogLevelFlags log_level, |
118 const gchar* message, | 116 const gchar* message, |
119 gpointer userdata) { | 117 gpointer userdata) { |
120 if (!log_domain) | 118 if (!log_domain) |
121 log_domain = "<unknown>"; | 119 log_domain = "<unknown>"; |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 628 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
631 | 629 |
632 #if defined(OS_MACOSX) | 630 #if defined(OS_MACOSX) |
633 MessageLoopForUI::current()->Run(); | 631 MessageLoopForUI::current()->Run(); |
634 #else | 632 #else |
635 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 633 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
636 #endif | 634 #endif |
637 } | 635 } |
638 | 636 |
639 } // namespace content | 637 } // namespace content |
OLD | NEW |