| 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 105 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 106 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 106 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 109 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 110 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 110 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 #if defined(USE_X11) | 113 #if defined(USE_X11) |
| 114 #include <X11/Xlib.h> | 114 #include "ui/gfx/x/x11_connection.h" |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 #if defined(USE_OZONE) | 117 #if defined(USE_OZONE) |
| 118 #include "ui/ozone/ozone_platform.h" | 118 #include "ui/ozone/ozone_platform.h" |
| 119 #endif | 119 #endif |
| 120 | 120 |
| 121 // One of the linux specific headers defines this as a macro. | 121 // One of the linux specific headers defines this as a macro. |
| 122 #ifdef DestroyAll | 122 #ifdef DestroyAll |
| 123 #undef DestroyAll | 123 #undef DestroyAll |
| 124 #endif | 124 #endif |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 357 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 358 // No thread should be created before this call, as SetupSandbox() | 358 // No thread should be created before this call, as SetupSandbox() |
| 359 // will end-up using fork(). | 359 // will end-up using fork(). |
| 360 SetupSandbox(parsed_command_line_); | 360 SetupSandbox(parsed_command_line_); |
| 361 #endif | 361 #endif |
| 362 | 362 |
| 363 #if defined(USE_X11) | 363 #if defined(USE_X11) |
| 364 if (parsed_command_line_.HasSwitch(switches::kSingleProcess) || | 364 if (parsed_command_line_.HasSwitch(switches::kSingleProcess) || |
| 365 parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { | 365 parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { |
| 366 if (!XInitThreads()) { | 366 if (!gfx::InitializeThreadedX11()) { |
| 367 LOG(ERROR) << "Failed to put Xlib into threaded mode."; | 367 LOG(ERROR) << "Failed to put Xlib into threaded mode."; |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 #endif | 370 #endif |
| 371 | 371 |
| 372 // GLib's spawning of new processes is buggy, so it's important that at this | 372 // GLib's spawning of new processes is buggy, so it's important that at this |
| 373 // point GLib does not need to start DBUS. Chrome should always start with | 373 // point GLib does not need to start DBUS. Chrome should always start with |
| 374 // DBUS_SESSION_BUS_ADDRESS properly set. See crbug.com/309093. | 374 // DBUS_SESSION_BUS_ADDRESS properly set. See crbug.com/309093. |
| 375 #if defined(USE_GLIB) | 375 #if defined(USE_GLIB) |
| 376 // g_type_init will be deprecated in 2.36. 2.35 is the development | 376 // g_type_init will be deprecated in 2.36. 2.35 is the development |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 base::TimeDelta::FromSeconds(delay_secs)); | 1124 base::TimeDelta::FromSeconds(delay_secs)); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1127 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
| 1128 is_tracing_startup_ = false; | 1128 is_tracing_startup_ = false; |
| 1129 TracingController::GetInstance()->DisableRecording( | 1129 TracingController::GetInstance()->DisableRecording( |
| 1130 trace_file, base::Bind(&OnStoppedStartupTracing)); | 1130 trace_file, base::Bind(&OnStoppedStartupTracing)); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 } // namespace content | 1133 } // namespace content |
| OLD | NEW |