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

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

Issue 2132573002: Allow mojo sync calls in single-process mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 // Register the main thread by instantiating it, but don't call any methods. 1155 // Register the main thread by instantiating it, but don't call any methods.
1156 main_thread_.reset( 1156 main_thread_.reset(
1157 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); 1157 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current()));
1158 } 1158 }
1159 1159
1160 int BrowserMainLoop::BrowserThreadsStarted() { 1160 int BrowserMainLoop::BrowserThreadsStarted() {
1161 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); 1161 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted");
1162 1162
1163 // Bring up Mojo IPC and shell as early as possible. 1163 // Bring up Mojo IPC and shell as early as possible.
1164 1164
1165 // Disallow mojo sync call in the browser process. 1165 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) {
1166 bool sync_call_allowed = false; 1166 // Disallow mojo sync calls in the browser process. Note that we allow sync
1167 MojoResult result = mojo::edk::SetProperty( 1167 // calls in single-process mode since renderer IPCs are made from a browser
1168 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); 1168 // thread.
1169 DCHECK_EQ(MOJO_RESULT_OK, result); 1169 bool sync_call_allowed = false;
1170 MojoResult result = mojo::edk::SetProperty(
1171 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed);
1172 DCHECK_EQ(MOJO_RESULT_OK, result);
1173 }
1170 1174
1171 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( 1175 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport(
1172 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) 1176 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO)
1173 ->task_runner())); 1177 ->task_runner()));
1174 1178
1175 mojo_shell_context_.reset(new MojoShellContext); 1179 mojo_shell_context_.reset(new MojoShellContext);
1176 if (shell::ShellIsRemote()) { 1180 if (shell::ShellIsRemote()) {
1177 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) 1181 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
1178 // TODO(rockot): Remove the blocking wait for init. 1182 // TODO(rockot): Remove the blocking wait for init.
1179 // http://crbug.com/594852. 1183 // http://crbug.com/594852.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 std::move(worker_task_runner), 1521 std::move(worker_task_runner),
1518 MediaInternals::GetInstance()); 1522 MediaInternals::GetInstance());
1519 } 1523 }
1520 CHECK(audio_manager_); 1524 CHECK(audio_manager_);
1521 1525
1522 if (use_hang_monitor) 1526 if (use_hang_monitor)
1523 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); 1527 media::AudioManager::StartHangMonitor(io_thread_->task_runner());
1524 } 1528 }
1525 1529
1526 } // namespace content 1530 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698