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 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 g_log_set_handler(kLogDomains[i], | 291 g_log_set_handler(kLogDomains[i], |
292 static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION | | 292 static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION | |
293 G_LOG_FLAG_FATAL | | 293 G_LOG_FLAG_FATAL | |
294 G_LOG_LEVEL_ERROR | | 294 G_LOG_LEVEL_ERROR | |
295 G_LOG_LEVEL_CRITICAL | | 295 G_LOG_LEVEL_CRITICAL | |
296 G_LOG_LEVEL_WARNING), | 296 G_LOG_LEVEL_WARNING), |
297 GLibLogHandler, | 297 GLibLogHandler, |
298 NULL); | 298 NULL); |
299 } | 299 } |
300 } | 300 } |
301 #endif | 301 #endif // defined(USE_GLIB) |
| 302 |
| 303 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
| 304 void WaitForMojoShellInitialize() { |
| 305 // TODO(rockot): Remove this. http://crbug.com/594852. |
| 306 base::RunLoop wait_loop; |
| 307 MojoShellConnectionImpl::Get()->shell_connection()->set_initialize_handler( |
| 308 wait_loop.QuitClosure()); |
| 309 wait_loop.Run(); |
| 310 } |
| 311 #endif // defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
302 | 312 |
303 void OnStoppedStartupTracing(const base::FilePath& trace_file) { | 313 void OnStoppedStartupTracing(const base::FilePath& trace_file) { |
304 VLOG(0) << "Completed startup tracing to " << trace_file.value(); | 314 VLOG(0) << "Completed startup tracing to " << trace_file.value(); |
305 } | 315 } |
306 | 316 |
307 // Disable optimizations for this block of functions so the compiler doesn't | 317 // Disable optimizations for this block of functions so the compiler doesn't |
308 // merge them all together. This makes it possible to tell what thread was | 318 // merge them all together. This makes it possible to tell what thread was |
309 // unresponsive by inspecting the callstack. | 319 // unresponsive by inspecting the callstack. |
310 MSVC_DISABLE_OPTIMIZE() | 320 MSVC_DISABLE_OPTIMIZE() |
311 MSVC_PUSH_DISABLE_WARNING(4748) | 321 MSVC_PUSH_DISABLE_WARNING(4748) |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 | 1193 |
1184 if (IsRunningInMojoShell()) { | 1194 if (IsRunningInMojoShell()) { |
1185 if (!MojoShellConnectionImpl::CreateUsingFactory()) { | 1195 if (!MojoShellConnectionImpl::CreateUsingFactory()) { |
1186 mojo::edk::SetParentPipeHandleFromCommandLine(); | 1196 mojo::edk::SetParentPipeHandleFromCommandLine(); |
1187 MojoShellConnectionImpl::Create(); | 1197 MojoShellConnectionImpl::Create(); |
1188 MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine(); | 1198 MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine(); |
1189 } | 1199 } |
1190 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1200 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
1191 MojoShellConnection* mojo_shell_connection = MojoShellConnection::Get(); | 1201 MojoShellConnection* mojo_shell_connection = MojoShellConnection::Get(); |
1192 if (mojo_shell_connection) { | 1202 if (mojo_shell_connection) { |
| 1203 // TODO(rockot): Remove the blocking wait for init. |
| 1204 // http://crbug.com/594852. |
| 1205 WaitForMojoShellInitialize(); |
1193 views::WindowManagerConnection::Create( | 1206 views::WindowManagerConnection::Create( |
1194 mojo_shell_connection->GetConnector(), | 1207 mojo_shell_connection->GetConnector(), |
1195 mojo_shell_connection->GetIdentity()); | 1208 mojo_shell_connection->GetIdentity()); |
1196 } | 1209 } |
1197 #endif | 1210 #endif |
1198 } | 1211 } |
1199 | 1212 |
1200 mojo_shell_context_.reset(new MojoShellContext); | 1213 mojo_shell_context_.reset(new MojoShellContext); |
1201 #if defined(OS_MACOSX) | 1214 #if defined(OS_MACOSX) |
1202 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); | 1215 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 audio_task_runner = audio_thread_->task_runner(); | 1523 audio_task_runner = audio_thread_->task_runner(); |
1511 worker_task_runner = audio_thread_->task_runner(); | 1524 worker_task_runner = audio_thread_->task_runner(); |
1512 monitor_task_runner = io_thread_->task_runner(); | 1525 monitor_task_runner = io_thread_->task_runner(); |
1513 #endif // defined(OS_MACOSX) | 1526 #endif // defined(OS_MACOSX) |
1514 audio_manager_ = media::AudioManager::Create( | 1527 audio_manager_ = media::AudioManager::Create( |
1515 std::move(audio_task_runner), std::move(worker_task_runner), | 1528 std::move(audio_task_runner), std::move(worker_task_runner), |
1516 std::move(monitor_task_runner), MediaInternals::GetInstance()); | 1529 std::move(monitor_task_runner), MediaInternals::GetInstance()); |
1517 } | 1530 } |
1518 | 1531 |
1519 } // namespace content | 1532 } // namespace content |
OLD | NEW |