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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 #include "content/browser/compositor/image_transport_factory.h" | 91 #include "content/browser/compositor/image_transport_factory.h" |
92 #endif | 92 #endif |
93 | 93 |
94 #if defined(USE_AURA) | 94 #if defined(USE_AURA) |
95 #include "content/public/browser/context_factory.h" | 95 #include "content/public/browser/context_factory.h" |
96 #include "ui/aura/env.h" | 96 #include "ui/aura/env.h" |
97 #endif | 97 #endif |
98 | 98 |
99 #if !defined(OS_IOS) | 99 #if !defined(OS_IOS) |
100 #include "content/browser/renderer_host/render_process_host_impl.h" | 100 #include "content/browser/renderer_host/render_process_host_impl.h" |
101 #include "ipc/attachment_broker.h" | |
102 #include "ipc/attachment_broker_privileged.h" | |
101 #endif | 103 #endif |
102 | 104 |
103 #if defined(OS_ANDROID) | 105 #if defined(OS_ANDROID) |
104 #include "base/android/jni_android.h" | 106 #include "base/android/jni_android.h" |
105 #include "components/tracing/graphics_memory_dump_provider_android.h" | 107 #include "components/tracing/graphics_memory_dump_provider_android.h" |
106 #include "content/browser/android/browser_startup_controller.h" | 108 #include "content/browser/android/browser_startup_controller.h" |
107 #include "content/browser/android/browser_surface_texture_manager.h" | 109 #include "content/browser/android/browser_surface_texture_manager.h" |
108 #include "content/browser/android/in_process_surface_texture_manager.h" | 110 #include "content/browser/android/in_process_surface_texture_manager.h" |
109 #include "content/browser/android/tracing_controller_android.h" | 111 #include "content/browser/android/tracing_controller_android.h" |
110 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" | 112 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" |
111 #include "content/public/browser/screen_orientation_provider.h" | 113 #include "content/public/browser/screen_orientation_provider.h" |
112 #include "ui/gl/gl_surface.h" | 114 #include "ui/gl/gl_surface.h" |
113 #endif | 115 #endif |
114 | 116 |
115 #if defined(OS_MACOSX) && !defined(OS_IOS) | 117 #if defined(OS_MACOSX) && !defined(OS_IOS) |
116 #include "base/memory/memory_pressure_monitor_mac.h" | 118 #include "base/memory/memory_pressure_monitor_mac.h" |
117 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 119 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
118 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 120 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
119 #include "content/browser/compositor/browser_compositor_view_mac.h" | 121 #include "content/browser/compositor/browser_compositor_view_mac.h" |
122 #include "content/browser/mach_broker_mac.h" | |
120 #include "content/browser/theme_helper_mac.h" | 123 #include "content/browser/theme_helper_mac.h" |
121 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | 124 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" |
122 #endif | 125 #endif |
123 | 126 |
124 #if defined(USE_OZONE) | 127 #if defined(USE_OZONE) |
125 #include "ui/ozone/public/client_native_pixmap_factory.h" | 128 #include "ui/ozone/public/client_native_pixmap_factory.h" |
126 #include "ui/ozone/public/ozone_platform.h" | 129 #include "ui/ozone/public/ozone_platform.h" |
127 #endif | 130 #endif |
128 | 131 |
129 #if defined(OS_WIN) | 132 #if defined(OS_WIN) |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1193 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); | 1196 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); |
1194 | 1197 |
1195 #if !defined(OS_IOS) | 1198 #if !defined(OS_IOS) |
1196 // Bring up Mojo IPC and shell as early as possible. | 1199 // Bring up Mojo IPC and shell as early as possible. |
1197 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( | 1200 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( |
1198 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 1201 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
1199 ->task_runner())); | 1202 ->task_runner())); |
1200 mojo_shell_context_.reset(new MojoShellContext); | 1203 mojo_shell_context_.reset(new MojoShellContext); |
1201 #endif | 1204 #endif |
1202 | 1205 |
1206 #if USE_ATTACHMENT_BROKER | |
1207 // Construct the privileged attachment broker early. This ensures that when a | |
1208 // test is being run in one of the single process modes, the global attachment | |
1209 // broker is the privileged attachment broker, rather than an unprivileged | |
1210 // attachment broker. | |
1211 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
1212 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded( | |
erikchen
2016/03/16 17:33:11
It's probably the case that this can just become C
| |
1213 MachBroker::GetInstance()); | |
1214 mojo::edk::SetMachPortProviderIfNeeded(MachBroker::GetInstance()); | |
1215 #else | |
1216 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); | |
1217 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | |
1218 #endif // USE_ATTACHMENT_BROKER | |
1219 | |
1203 #if !defined(OS_IOS) | 1220 #if !defined(OS_IOS) |
1204 indexed_db_thread_.reset(new base::Thread("IndexedDB")); | 1221 indexed_db_thread_.reset(new base::Thread("IndexedDB")); |
1205 indexed_db_thread_->Start(); | 1222 indexed_db_thread_->Start(); |
1206 #endif | 1223 #endif |
1207 | 1224 |
1208 #if !defined(OS_IOS) | 1225 #if !defined(OS_IOS) |
1209 HistogramSynchronizer::GetInstance(); | 1226 HistogramSynchronizer::GetInstance(); |
1210 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 1227 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
1211 // Up the priority of the UI thread. | 1228 // Up the priority of the UI thread. |
1212 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); | 1229 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1477 DCHECK(is_tracing_startup_for_duration_); | 1494 DCHECK(is_tracing_startup_for_duration_); |
1478 | 1495 |
1479 is_tracing_startup_for_duration_ = false; | 1496 is_tracing_startup_for_duration_ = false; |
1480 TracingController::GetInstance()->StopTracing( | 1497 TracingController::GetInstance()->StopTracing( |
1481 TracingController::CreateFileSink( | 1498 TracingController::CreateFileSink( |
1482 startup_trace_file_, | 1499 startup_trace_file_, |
1483 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1500 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1484 } | 1501 } |
1485 | 1502 |
1486 } // namespace content | 1503 } // namespace content |
OLD | NEW |