Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1915053004: mus/chrome: Always wait for the mojo shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 base::RunLoop wait_loop;
306 MojoShellConnectionImpl::Get()->shell_connection()->set_initialize_handler(
307 wait_loop.QuitClosure());
308 wait_loop.Run();
309 }
310 #endif // defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
302 311
303 void OnStoppedStartupTracing(const base::FilePath& trace_file) { 312 void OnStoppedStartupTracing(const base::FilePath& trace_file) {
304 VLOG(0) << "Completed startup tracing to " << trace_file.value(); 313 VLOG(0) << "Completed startup tracing to " << trace_file.value();
305 } 314 }
306 315
307 // Disable optimizations for this block of functions so the compiler doesn't 316 // 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 317 // merge them all together. This makes it possible to tell what thread was
309 // unresponsive by inspecting the callstack. 318 // unresponsive by inspecting the callstack.
310 MSVC_DISABLE_OPTIMIZE() 319 MSVC_DISABLE_OPTIMIZE()
311 MSVC_PUSH_DISABLE_WARNING(4748) 320 MSVC_PUSH_DISABLE_WARNING(4748)
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 1192
1184 if (IsRunningInMojoShell()) { 1193 if (IsRunningInMojoShell()) {
1185 if (!MojoShellConnectionImpl::CreateUsingFactory()) { 1194 if (!MojoShellConnectionImpl::CreateUsingFactory()) {
1186 mojo::edk::SetParentPipeHandleFromCommandLine(); 1195 mojo::edk::SetParentPipeHandleFromCommandLine();
1187 MojoShellConnectionImpl::Create(); 1196 MojoShellConnectionImpl::Create();
1188 MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine(); 1197 MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine();
1189 } 1198 }
1190 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) 1199 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
1191 MojoShellConnection* mojo_shell_connection = MojoShellConnection::Get(); 1200 MojoShellConnection* mojo_shell_connection = MojoShellConnection::Get();
1192 if (mojo_shell_connection) { 1201 if (mojo_shell_connection) {
1202 WaitForMojoShellInitialize();
Ken Rockot(use gerrit already) 2016/04/26 03:28:55 Do you think there may ever be a future where we c
sadrul 2016/04/26 03:43:35 I have added back the TODO. It might be possible
1193 views::WindowManagerConnection::Create( 1203 views::WindowManagerConnection::Create(
1194 mojo_shell_connection->GetConnector(), 1204 mojo_shell_connection->GetConnector(),
1195 mojo_shell_connection->GetIdentity()); 1205 mojo_shell_connection->GetIdentity());
1196 } 1206 }
1197 #endif 1207 #endif
1198 } 1208 }
1199 1209
1200 mojo_shell_context_.reset(new MojoShellContext); 1210 mojo_shell_context_.reset(new MojoShellContext);
1201 #if defined(OS_MACOSX) 1211 #if defined(OS_MACOSX)
1202 mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); 1212 mojo::edk::SetMachPortProvider(MachBroker::GetInstance());
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 audio_task_runner = audio_thread_->task_runner(); 1520 audio_task_runner = audio_thread_->task_runner();
1511 worker_task_runner = audio_thread_->task_runner(); 1521 worker_task_runner = audio_thread_->task_runner();
1512 monitor_task_runner = io_thread_->task_runner(); 1522 monitor_task_runner = io_thread_->task_runner();
1513 #endif // defined(OS_MACOSX) 1523 #endif // defined(OS_MACOSX)
1514 audio_manager_ = media::AudioManager::Create( 1524 audio_manager_ = media::AudioManager::Create(
1515 std::move(audio_task_runner), std::move(worker_task_runner), 1525 std::move(audio_task_runner), std::move(worker_task_runner),
1516 std::move(monitor_task_runner), MediaInternals::GetInstance()); 1526 std::move(monitor_task_runner), MediaInternals::GetInstance());
1517 } 1527 }
1518 1528
1519 } // namespace content 1529 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/mojo_test_connector.cc ('k') | content/common/mojo/mojo_shell_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698