| 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 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 return false; | 1650 return false; |
| 1651 | 1651 |
| 1652 mark_child_process_activity_time(); | 1652 mark_child_process_activity_time(); |
| 1653 if (msg.routing_id() == MSG_ROUTING_CONTROL) { | 1653 if (msg.routing_id() == MSG_ROUTING_CONTROL) { |
| 1654 // Dispatch control messages. | 1654 // Dispatch control messages. |
| 1655 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) | 1655 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) |
| 1656 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, | 1656 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, |
| 1657 OnShutdownRequest) | 1657 OnShutdownRequest) |
| 1658 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged, | 1658 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged, |
| 1659 SuddenTerminationChanged) | 1659 SuddenTerminationChanged) |
| 1660 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_GetUniversalAccessDisposition, |
| 1661 OnGetUniversalAccessDisposition); |
| 1660 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, | 1662 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, |
| 1661 OnUserMetricsRecordAction) | 1663 OnUserMetricsRecordAction) |
| 1662 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) | 1664 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) |
| 1663 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK) | 1665 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK) |
| 1664 #if defined(ENABLE_WEBRTC) | 1666 #if defined(ENABLE_WEBRTC) |
| 1665 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer, | 1667 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer, |
| 1666 OnRegisterAecDumpConsumer) | 1668 OnRegisterAecDumpConsumer) |
| 1667 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer, | 1669 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer, |
| 1668 OnUnregisterAecDumpConsumer) | 1670 OnUnregisterAecDumpConsumer) |
| 1669 #endif | 1671 #endif |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2385 | 2387 |
| 2386 mojo_application_host_->WillDestroySoon(); | 2388 mojo_application_host_->WillDestroySoon(); |
| 2387 | 2389 |
| 2388 Send(new ChildProcessMsg_Shutdown()); | 2390 Send(new ChildProcessMsg_Shutdown()); |
| 2389 } | 2391 } |
| 2390 | 2392 |
| 2391 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { | 2393 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { |
| 2392 SetSuddenTerminationAllowed(enabled); | 2394 SetSuddenTerminationAllowed(enabled); |
| 2393 } | 2395 } |
| 2394 | 2396 |
| 2397 void RenderProcessHostImpl::OnGetUniversalAccessDisposition( |
| 2398 bool* is_access_grantable) { |
| 2399 DCHECK(is_access_grantable); |
| 2400 *is_access_grantable = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2401 switches::kDisableWebSecurity); |
| 2402 } |
| 2403 |
| 2395 void RenderProcessHostImpl::UpdateProcessPriority() { | 2404 void RenderProcessHostImpl::UpdateProcessPriority() { |
| 2396 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) { | 2405 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) { |
| 2397 is_process_backgrounded_ = false; | 2406 is_process_backgrounded_ = false; |
| 2398 return; | 2407 return; |
| 2399 } | 2408 } |
| 2400 | 2409 |
| 2401 // We background a process as soon as it hosts no active audio streams and no | 2410 // We background a process as soon as it hosts no active audio streams and no |
| 2402 // visible widgets -- the callers must call this function whenever we | 2411 // visible widgets -- the callers must call this function whenever we |
| 2403 // transition in/out of those states. | 2412 // transition in/out of those states. |
| 2404 const bool should_background = | 2413 const bool should_background = |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 void RenderProcessHostImpl::GetAudioOutputControllers( | 2680 void RenderProcessHostImpl::GetAudioOutputControllers( |
| 2672 const GetAudioOutputControllersCallback& callback) const { | 2681 const GetAudioOutputControllersCallback& callback) const { |
| 2673 audio_renderer_host()->GetOutputControllers(callback); | 2682 audio_renderer_host()->GetOutputControllers(callback); |
| 2674 } | 2683 } |
| 2675 | 2684 |
| 2676 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2685 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
| 2677 return bluetooth_dispatcher_host_.get(); | 2686 return bluetooth_dispatcher_host_.get(); |
| 2678 } | 2687 } |
| 2679 | 2688 |
| 2680 } // namespace content | 2689 } // namespace content |
| OLD | NEW |