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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "content/public/common/result_codes.h" | 62 #include "content/public/common/result_codes.h" |
63 #include "crypto/nss_util.h" | 63 #include "crypto/nss_util.h" |
64 #include "device/battery/battery_status_service.h" | 64 #include "device/battery/battery_status_service.h" |
65 #include "media/audio/audio_manager.h" | 65 #include "media/audio/audio_manager.h" |
66 #include "media/base/media.h" | 66 #include "media/base/media.h" |
67 #include "media/base/user_input_monitor.h" | 67 #include "media/base/user_input_monitor.h" |
68 #include "media/midi/midi_manager.h" | 68 #include "media/midi/midi_manager.h" |
69 #include "net/base/network_change_notifier.h" | 69 #include "net/base/network_change_notifier.h" |
70 #include "net/socket/client_socket_factory.h" | 70 #include "net/socket/client_socket_factory.h" |
71 #include "net/ssl/ssl_config_service.h" | 71 #include "net/ssl/ssl_config_service.h" |
| 72 #include "ipc/mojo/scoped_ipc_support.h" |
72 #include "skia/ext/skia_memory_dump_provider.h" | 73 #include "skia/ext/skia_memory_dump_provider.h" |
73 #include "ui/base/clipboard/clipboard.h" | 74 #include "ui/base/clipboard/clipboard.h" |
74 | 75 |
75 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 76 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
76 #include "content/browser/compositor/image_transport_factory.h" | 77 #include "content/browser/compositor/image_transport_factory.h" |
77 #endif | 78 #endif |
78 | 79 |
79 #if defined(USE_AURA) | 80 #if defined(USE_AURA) |
80 #include "content/public/browser/context_factory.h" | 81 #include "content/public/browser/context_factory.h" |
81 #include "ui/aura/env.h" | 82 #include "ui/aura/env.h" |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); | 921 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); |
921 | 922 |
922 // Teardown may start in PostMainMessageLoopRun, and during teardown we | 923 // Teardown may start in PostMainMessageLoopRun, and during teardown we |
923 // need to be able to perform IO. | 924 // need to be able to perform IO. |
924 base::ThreadRestrictions::SetIOAllowed(true); | 925 base::ThreadRestrictions::SetIOAllowed(true); |
925 BrowserThread::PostTask( | 926 BrowserThread::PostTask( |
926 BrowserThread::IO, FROM_HERE, | 927 BrowserThread::IO, FROM_HERE, |
927 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 928 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
928 true)); | 929 true)); |
929 | 930 |
| 931 mojo_ipc_support_.reset(); |
930 mojo_shell_context_.reset(); | 932 mojo_shell_context_.reset(); |
931 | 933 |
932 #if !defined(OS_IOS) | 934 #if !defined(OS_IOS) |
933 if (RenderProcessHost::run_renderer_in_process()) | 935 if (RenderProcessHost::run_renderer_in_process()) |
934 RenderProcessHostImpl::ShutDownInProcessRenderer(); | 936 RenderProcessHostImpl::ShutDownInProcessRenderer(); |
935 #endif | 937 #endif |
936 | 938 |
937 if (parts_) { | 939 if (parts_) { |
938 TRACE_EVENT0("shutdown", | 940 TRACE_EVENT0("shutdown", |
939 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); | 941 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 } | 1261 } |
1260 | 1262 |
1261 #if defined(OS_MACOSX) | 1263 #if defined(OS_MACOSX) |
1262 ThemeHelperMac::GetInstance(); | 1264 ThemeHelperMac::GetInstance(); |
1263 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); | 1265 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); |
1264 #endif // defined(OS_MACOSX) | 1266 #endif // defined(OS_MACOSX) |
1265 | 1267 |
1266 #endif // !defined(OS_IOS) | 1268 #endif // !defined(OS_IOS) |
1267 | 1269 |
1268 mojo_shell_context_.reset(new MojoShellContext); | 1270 mojo_shell_context_.reset(new MojoShellContext); |
| 1271 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( |
| 1272 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
| 1273 ->task_runner())); |
1269 | 1274 |
1270 return result_code_; | 1275 return result_code_; |
1271 } | 1276 } |
1272 | 1277 |
1273 bool BrowserMainLoop::UsingInProcessGpu() const { | 1278 bool BrowserMainLoop::UsingInProcessGpu() const { |
1274 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || | 1279 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || |
1275 parsed_command_line_.HasSwitch(switches::kInProcessGPU); | 1280 parsed_command_line_.HasSwitch(switches::kInProcessGPU); |
1276 } | 1281 } |
1277 | 1282 |
1278 bool BrowserMainLoop::InitializeToolkit() { | 1283 bool BrowserMainLoop::InitializeToolkit() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 DCHECK(is_tracing_startup_for_duration_); | 1397 DCHECK(is_tracing_startup_for_duration_); |
1393 | 1398 |
1394 is_tracing_startup_for_duration_ = false; | 1399 is_tracing_startup_for_duration_ = false; |
1395 TracingController::GetInstance()->DisableRecording( | 1400 TracingController::GetInstance()->DisableRecording( |
1396 TracingController::CreateFileSink( | 1401 TracingController::CreateFileSink( |
1397 startup_trace_file_, | 1402 startup_trace_file_, |
1398 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1403 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1399 } | 1404 } |
1400 | 1405 |
1401 } // namespace content | 1406 } // namespace content |
OLD | NEW |