| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 G_LOG_FLAG_FATAL | | 270 G_LOG_FLAG_FATAL | |
| 271 G_LOG_LEVEL_ERROR | | 271 G_LOG_LEVEL_ERROR | |
| 272 G_LOG_LEVEL_CRITICAL | | 272 G_LOG_LEVEL_CRITICAL | |
| 273 G_LOG_LEVEL_WARNING), | 273 G_LOG_LEVEL_WARNING), |
| 274 GLibLogHandler, | 274 GLibLogHandler, |
| 275 NULL); | 275 NULL); |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 #endif // defined(USE_GLIB) | 278 #endif // defined(USE_GLIB) |
| 279 | 279 |
| 280 #if defined(USE_AURA) | |
| 281 void WaitForMojoShellInitialize() { | |
| 282 // TODO(rockot): Remove this. http://crbug.com/594852. | |
| 283 base::RunLoop wait_loop; | |
| 284 MojoShellConnection::GetForProcess()->SetInitializeHandler( | |
| 285 wait_loop.QuitClosure()); | |
| 286 wait_loop.Run(); | |
| 287 } | |
| 288 #endif // defined(USE_AURA) | |
| 289 | |
| 290 void OnStoppedStartupTracing(const base::FilePath& trace_file) { | 280 void OnStoppedStartupTracing(const base::FilePath& trace_file) { |
| 291 VLOG(0) << "Completed startup tracing to " << trace_file.value(); | 281 VLOG(0) << "Completed startup tracing to " << trace_file.value(); |
| 292 } | 282 } |
| 293 | 283 |
| 294 // Disable optimizations for this block of functions so the compiler doesn't | 284 // Disable optimizations for this block of functions so the compiler doesn't |
| 295 // merge them all together. This makes it possible to tell what thread was | 285 // merge them all together. This makes it possible to tell what thread was |
| 296 // unresponsive by inspecting the callstack. | 286 // unresponsive by inspecting the callstack. |
| 297 MSVC_DISABLE_OPTIMIZE() | 287 MSVC_DISABLE_OPTIMIZE() |
| 298 MSVC_PUSH_DISABLE_WARNING(4748) | 288 MSVC_PUSH_DISABLE_WARNING(4748) |
| 299 | 289 |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); | 1180 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); |
| 1191 DCHECK_EQ(MOJO_RESULT_OK, result); | 1181 DCHECK_EQ(MOJO_RESULT_OK, result); |
| 1192 } | 1182 } |
| 1193 | 1183 |
| 1194 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( | 1184 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( |
| 1195 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 1185 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
| 1196 ->task_runner())); | 1186 ->task_runner())); |
| 1197 | 1187 |
| 1198 mojo_shell_context_.reset(new MojoShellContext); | 1188 mojo_shell_context_.reset(new MojoShellContext); |
| 1199 #if defined(USE_AURA) | 1189 #if defined(USE_AURA) |
| 1200 // TODO(rockot): Remove the blocking wait for init. | 1190 if (shell::ShellIsRemote()) { |
| 1201 // http://crbug.com/594852. | |
| 1202 if (shell::ShellIsRemote() && MojoShellConnection::GetForProcess()) { | |
| 1203 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 1191 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1204 switches::kIsRunningInMash); | 1192 switches::kIsRunningInMash); |
| 1205 WaitForMojoShellInitialize(); | |
| 1206 } | 1193 } |
| 1207 #endif | 1194 #endif |
| 1208 | 1195 |
| 1209 #if defined(OS_MACOSX) | 1196 #if defined(OS_MACOSX) |
| 1210 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); | 1197 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); |
| 1211 #endif // defined(OS_MACOSX) | 1198 #endif // defined(OS_MACOSX) |
| 1212 | 1199 |
| 1213 indexed_db_thread_.reset(new base::Thread("IndexedDB")); | 1200 indexed_db_thread_.reset(new base::Thread("IndexedDB")); |
| 1214 indexed_db_thread_->Start(); | 1201 indexed_db_thread_->Start(); |
| 1215 | 1202 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1501 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
| 1515 audio_thread_->task_runner(); | 1502 audio_thread_->task_runner(); |
| 1516 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1503 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
| 1517 std::move(worker_task_runner), | 1504 std::move(worker_task_runner), |
| 1518 MediaInternals::GetInstance()); | 1505 MediaInternals::GetInstance()); |
| 1519 } | 1506 } |
| 1520 CHECK(audio_manager_); | 1507 CHECK(audio_manager_); |
| 1521 } | 1508 } |
| 1522 | 1509 |
| 1523 } // namespace content | 1510 } // namespace content |
| OLD | NEW |