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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 | 1148 |
1149 // Register the main thread by instantiating it, but don't call any methods. | 1149 // Register the main thread by instantiating it, but don't call any methods. |
1150 main_thread_.reset( | 1150 main_thread_.reset( |
1151 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); | 1151 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); |
1152 } | 1152 } |
1153 | 1153 |
1154 int BrowserMainLoop::BrowserThreadsStarted() { | 1154 int BrowserMainLoop::BrowserThreadsStarted() { |
1155 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); | 1155 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); |
1156 | 1156 |
1157 // Bring up Mojo IPC and shell as early as possible. | 1157 // Bring up Mojo IPC and shell as early as possible. |
| 1158 |
| 1159 // Disallow mojo sync call in the browser process. |
| 1160 bool sync_call_allowed = false; |
| 1161 MojoResult result = mojo::edk::SetProperty( |
| 1162 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); |
| 1163 DCHECK_EQ(MOJO_RESULT_OK, result); |
| 1164 |
1158 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( | 1165 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( |
1159 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 1166 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
1160 ->task_runner())); | 1167 ->task_runner())); |
1161 | 1168 |
1162 mojo_shell_context_.reset(new MojoShellContext); | 1169 mojo_shell_context_.reset(new MojoShellContext); |
1163 if (shell::ShellIsRemote()) { | 1170 if (shell::ShellIsRemote()) { |
1164 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1171 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
1165 // TODO(rockot): Remove the blocking wait for init. | 1172 // TODO(rockot): Remove the blocking wait for init. |
1166 // http://crbug.com/594852. | 1173 // http://crbug.com/594852. |
1167 if (MojoShellConnection::GetForProcess()) | 1174 if (MojoShellConnection::GetForProcess()) |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 std::move(worker_task_runner), | 1504 std::move(worker_task_runner), |
1498 MediaInternals::GetInstance()); | 1505 MediaInternals::GetInstance()); |
1499 } | 1506 } |
1500 CHECK(audio_manager_); | 1507 CHECK(audio_manager_); |
1501 | 1508 |
1502 if (use_hang_monitor) | 1509 if (use_hang_monitor) |
1503 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); | 1510 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); |
1504 } | 1511 } |
1505 | 1512 |
1506 } // namespace content | 1513 } // namespace content |
OLD | NEW |