| 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(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 280 #if defined(USE_AURA) |
| 281 void WaitForMojoShellInitialize() { | 281 void WaitForMojoShellInitialize() { |
| 282 // TODO(rockot): Remove this. http://crbug.com/594852. | 282 // TODO(rockot): Remove this. http://crbug.com/594852. |
| 283 base::RunLoop wait_loop; | 283 base::RunLoop wait_loop; |
| 284 MojoShellConnection::GetForProcess()->SetInitializeHandler( | 284 MojoShellConnection::GetForProcess()->SetInitializeHandler( |
| 285 wait_loop.QuitClosure()); | 285 wait_loop.QuitClosure()); |
| 286 wait_loop.Run(); | 286 wait_loop.Run(); |
| 287 } | 287 } |
| 288 #endif // defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 288 #endif // defined(USE_AURA) |
| 289 | 289 |
| 290 void OnStoppedStartupTracing(const base::FilePath& trace_file) { | 290 void OnStoppedStartupTracing(const base::FilePath& trace_file) { |
| 291 VLOG(0) << "Completed startup tracing to " << trace_file.value(); | 291 VLOG(0) << "Completed startup tracing to " << trace_file.value(); |
| 292 } | 292 } |
| 293 | 293 |
| 294 // Disable optimizations for this block of functions so the compiler doesn't | 294 // 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 | 295 // merge them all together. This makes it possible to tell what thread was |
| 296 // unresponsive by inspecting the callstack. | 296 // unresponsive by inspecting the callstack. |
| 297 MSVC_DISABLE_OPTIMIZE() | 297 MSVC_DISABLE_OPTIMIZE() |
| 298 MSVC_PUSH_DISABLE_WARNING(4748) | 298 MSVC_PUSH_DISABLE_WARNING(4748) |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 MojoResult result = mojo::edk::SetProperty( | 1189 MojoResult result = mojo::edk::SetProperty( |
| 1190 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); | 1190 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); |
| 1191 DCHECK_EQ(MOJO_RESULT_OK, result); | 1191 DCHECK_EQ(MOJO_RESULT_OK, result); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( | 1194 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( |
| 1195 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 1195 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
| 1196 ->task_runner())); | 1196 ->task_runner())); |
| 1197 | 1197 |
| 1198 mojo_shell_context_.reset(new MojoShellContext); | 1198 mojo_shell_context_.reset(new MojoShellContext); |
| 1199 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1199 #if defined(USE_AURA) |
| 1200 // TODO(rockot): Remove the blocking wait for init. | 1200 // TODO(rockot): Remove the blocking wait for init. |
| 1201 // http://crbug.com/594852. | 1201 // http://crbug.com/594852. |
| 1202 if (shell::ShellIsRemote() && MojoShellConnection::GetForProcess()) { | 1202 if (shell::ShellIsRemote() && MojoShellConnection::GetForProcess()) { |
| 1203 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 1203 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1204 switches::kIsRunningInMash); | 1204 switches::kIsRunningInMash); |
| 1205 WaitForMojoShellInitialize(); | 1205 WaitForMojoShellInitialize(); |
| 1206 } | 1206 } |
| 1207 #endif | 1207 #endif |
| 1208 | 1208 |
| 1209 #if defined(OS_MACOSX) | 1209 #if defined(OS_MACOSX) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1236 #elif defined(USE_AURA) || defined(OS_MACOSX) | 1236 #elif defined(USE_AURA) || defined(OS_MACOSX) |
| 1237 established_gpu_channel = true; | 1237 established_gpu_channel = true; |
| 1238 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || | 1238 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || |
| 1239 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || | 1239 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || |
| 1240 shell::ShellIsRemote()) { | 1240 shell::ShellIsRemote()) { |
| 1241 established_gpu_channel = always_uses_gpu = false; | 1241 established_gpu_channel = always_uses_gpu = false; |
| 1242 } | 1242 } |
| 1243 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1243 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1244 ImageTransportFactory::Initialize(); | 1244 ImageTransportFactory::Initialize(); |
| 1245 #if defined(USE_AURA) | 1245 #if defined(USE_AURA) |
| 1246 bool use_mus_in_renderer = false; | 1246 bool use_mus_in_renderer = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1247 #if defined (MOJO_SHELL_CLIENT) | |
| 1248 use_mus_in_renderer = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1249 switches::kUseMusInRenderer); | 1247 switches::kUseMusInRenderer); |
| 1250 #endif // defined(MOJO_SHELL_CLIENT); | |
| 1251 if (aura::Env::GetInstance() && !use_mus_in_renderer) { | 1248 if (aura::Env::GetInstance() && !use_mus_in_renderer) { |
| 1252 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); | 1249 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); |
| 1253 } | 1250 } |
| 1254 #endif // defined(USE_AURA) | 1251 #endif // defined(USE_AURA) |
| 1255 #endif // defined(OS_ANDROID) | 1252 #endif // defined(OS_ANDROID) |
| 1256 | 1253 |
| 1257 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that | 1254 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that |
| 1258 // unregistration happens on the IO thread (See | 1255 // unregistration happens on the IO thread (See |
| 1259 // BrowserProcessSubThread::IOThreadPreCleanUp). | 1256 // BrowserProcessSubThread::IOThreadPreCleanUp). |
| 1260 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1257 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1514 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
| 1518 audio_thread_->task_runner(); | 1515 audio_thread_->task_runner(); |
| 1519 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1516 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
| 1520 std::move(worker_task_runner), | 1517 std::move(worker_task_runner), |
| 1521 MediaInternals::GetInstance()); | 1518 MediaInternals::GetInstance()); |
| 1522 } | 1519 } |
| 1523 CHECK(audio_manager_); | 1520 CHECK(audio_manager_); |
| 1524 } | 1521 } |
| 1525 | 1522 |
| 1526 } // namespace content | 1523 } // namespace content |
| OLD | NEW |