Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 #include "ui/gl/gl_switches.h" | 181 #include "ui/gl/gl_switches.h" |
| 182 #include "ui/gl/gpu_switching_manager.h" | 182 #include "ui/gl/gpu_switching_manager.h" |
| 183 #include "ui/native_theme/native_theme_switches.h" | 183 #include "ui/native_theme/native_theme_switches.h" |
| 184 | 184 |
| 185 #if defined(OS_ANDROID) | 185 #if defined(OS_ANDROID) |
| 186 #include "content/browser/android/child_process_launcher_android.h" | 186 #include "content/browser/android/child_process_launcher_android.h" |
| 187 #include "content/browser/media/android/browser_demuxer_android.h" | 187 #include "content/browser/media/android/browser_demuxer_android.h" |
| 188 #include "content/browser/mojo/service_registrar_android.h" | 188 #include "content/browser/mojo/service_registrar_android.h" |
| 189 #include "content/browser/screen_orientation/screen_orientation_message_filter_a ndroid.h" | 189 #include "content/browser/screen_orientation/screen_orientation_message_filter_a ndroid.h" |
| 190 #include "ipc/ipc_sync_channel.h" | 190 #include "ipc/ipc_sync_channel.h" |
| 191 #include "media/audio/android/audio_manager_android.h" | |
| 191 #endif | 192 #endif |
| 192 | 193 |
| 193 #if defined(OS_WIN) | 194 #if defined(OS_WIN) |
| 194 #include "base/win/scoped_com_initializer.h" | 195 #include "base/win/scoped_com_initializer.h" |
| 195 #include "base/win/windows_version.h" | 196 #include "base/win/windows_version.h" |
| 196 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" | 197 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" |
| 197 #include "content/common/font_cache_dispatcher_win.h" | 198 #include "content/common/font_cache_dispatcher_win.h" |
| 198 #include "content/common/sandbox_win.h" | 199 #include "content/common/sandbox_win.h" |
| 199 #include "sandbox/win/src/sandbox_policy.h" | 200 #include "sandbox/win/src/sandbox_policy.h" |
| 200 #include "ui/display/win/dpi.h" | 201 #include "ui/display/win/dpi.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 // render process. This ensures that when a test is being run in one of the | 595 // render process. This ensures that when a test is being run in one of the |
| 595 // single process modes, the global attachment broker is the privileged | 596 // single process modes, the global attachment broker is the privileged |
| 596 // attachment broker, rather than an unprivileged attachment broker. | 597 // attachment broker, rather than an unprivileged attachment broker. |
| 597 #if defined(OS_MACOSX) | 598 #if defined(OS_MACOSX) |
| 598 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded( | 599 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded( |
| 599 MachBroker::GetInstance()); | 600 MachBroker::GetInstance()); |
| 600 #else | 601 #else |
| 601 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); | 602 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); |
| 602 #endif // defined(OS_MACOSX) | 603 #endif // defined(OS_MACOSX) |
| 603 #endif // USE_ATTACHMENT_BROKER | 604 #endif // USE_ATTACHMENT_BROKER |
| 605 | |
| 606 #if !defined(OS_MACOSX) | |
| 607 // On Mac audio thread is the UI thread, a hang monitor is not | |
| 608 // necessary or recommended. | |
| 609 media::AudioManager::StartHangMonitor( | |
|
no sievers
2016/06/21 23:57:22
Doesn't this blow up if being called repeatedly?
qinmin
2016/06/22 00:15:56
That doesn't work in ChromeOS case though since au
| |
| 610 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | |
| 611 #endif // !defined(OS_MACOSX) | |
| 612 #if defined(OS_ANDROID) | |
| 613 static_cast<media::AudioManagerAndroid*> ( | |
| 614 media::AudioManager::Get())->InitializeIfNeeded(); | |
| 615 #endif // defined(OS_ANDROID) | |
| 604 } | 616 } |
| 605 | 617 |
| 606 // static | 618 // static |
| 607 void RenderProcessHostImpl::ShutDownInProcessRenderer() { | 619 void RenderProcessHostImpl::ShutDownInProcessRenderer() { |
| 608 DCHECK(g_run_renderer_in_process_); | 620 DCHECK(g_run_renderer_in_process_); |
| 609 | 621 |
| 610 switch (g_all_hosts.Pointer()->size()) { | 622 switch (g_all_hosts.Pointer()->size()) { |
| 611 case 0: | 623 case 0: |
| 612 return; | 624 return; |
| 613 case 1: { | 625 case 1: { |
| (...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2811 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2823 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2812 | 2824 |
| 2813 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2825 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2814 // enough information here so that we can determine what the bad message was. | 2826 // enough information here so that we can determine what the bad message was. |
| 2815 base::debug::Alias(&error); | 2827 base::debug::Alias(&error); |
| 2816 bad_message::ReceivedBadMessage(process.get(), | 2828 bad_message::ReceivedBadMessage(process.get(), |
| 2817 bad_message::RPH_MOJO_PROCESS_ERROR); | 2829 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2818 } | 2830 } |
| 2819 | 2831 |
| 2820 } // namespace content | 2832 } // namespace content |
| OLD | NEW |