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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" | 50 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" |
51 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 51 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
52 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" | 52 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
53 #include "content/browser/child_process_security_policy_impl.h" | 53 #include "content/browser/child_process_security_policy_impl.h" |
54 #include "content/browser/device_sensors/device_light_message_filter.h" | 54 #include "content/browser/device_sensors/device_light_message_filter.h" |
55 #include "content/browser/device_sensors/device_motion_message_filter.h" | 55 #include "content/browser/device_sensors/device_motion_message_filter.h" |
56 #include "content/browser/device_sensors/device_orientation_absolute_message_fil
ter.h" | 56 #include "content/browser/device_sensors/device_orientation_absolute_message_fil
ter.h" |
57 #include "content/browser/device_sensors/device_orientation_message_filter.h" | 57 #include "content/browser/device_sensors/device_orientation_message_filter.h" |
58 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 58 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
59 #include "content/browser/dom_storage/dom_storage_message_filter.h" | 59 #include "content/browser/dom_storage/dom_storage_message_filter.h" |
60 #include "content/browser/download/mhtml_generation_manager.h" | |
61 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 60 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
62 #include "content/browser/fileapi/fileapi_message_filter.h" | 61 #include "content/browser/fileapi/fileapi_message_filter.h" |
63 #include "content/browser/frame_host/render_frame_message_filter.h" | 62 #include "content/browser/frame_host/render_frame_message_filter.h" |
64 #include "content/browser/geofencing/geofencing_dispatcher_host.h" | 63 #include "content/browser/geofencing/geofencing_dispatcher_host.h" |
65 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 64 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
66 #include "content/browser/gpu/compositor_util.h" | 65 #include "content/browser/gpu/compositor_util.h" |
67 #include "content/browser/gpu/gpu_data_manager_impl.h" | 66 #include "content/browser/gpu/gpu_data_manager_impl.h" |
68 #include "content/browser/gpu/gpu_process_host.h" | 67 #include "content/browser/gpu/gpu_process_host.h" |
69 #include "content/browser/gpu/shader_disk_cache.h" | 68 #include "content/browser/gpu/shader_disk_cache.h" |
70 #include "content/browser/histogram_message_filter.h" | 69 #include "content/browser/histogram_message_filter.h" |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 mark_child_process_activity_time(); | 1648 mark_child_process_activity_time(); |
1650 if (msg.routing_id() == MSG_ROUTING_CONTROL) { | 1649 if (msg.routing_id() == MSG_ROUTING_CONTROL) { |
1651 // Dispatch control messages. | 1650 // Dispatch control messages. |
1652 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) | 1651 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) |
1653 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, | 1652 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, |
1654 OnShutdownRequest) | 1653 OnShutdownRequest) |
1655 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged, | 1654 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged, |
1656 SuddenTerminationChanged) | 1655 SuddenTerminationChanged) |
1657 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, | 1656 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, |
1658 OnUserMetricsRecordAction) | 1657 OnUserMetricsRecordAction) |
1659 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) | |
1660 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK) | 1658 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK) |
1661 #if defined(ENABLE_WEBRTC) | 1659 #if defined(ENABLE_WEBRTC) |
1662 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer, | 1660 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer, |
1663 OnRegisterAecDumpConsumer) | 1661 OnRegisterAecDumpConsumer) |
1664 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer, | 1662 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer, |
1665 OnUnregisterAecDumpConsumer) | 1663 OnUnregisterAecDumpConsumer) |
1666 #endif | 1664 #endif |
1667 // Adding single handlers for your service here is fine, but once your | 1665 // Adding single handlers for your service here is fine, but once your |
1668 // service needs more than one handler, please extract them into a new | 1666 // service needs more than one handler, please extract them into a new |
1669 // message filter and add that filter to CreateMessageFilters(). | 1667 // message filter and add that filter to CreateMessageFilters(). |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 } | 2546 } |
2549 | 2547 |
2550 void RenderProcessHostImpl::OnCloseACK(int old_route_id) { | 2548 void RenderProcessHostImpl::OnCloseACK(int old_route_id) { |
2551 SessionStorageHolder* holder = | 2549 SessionStorageHolder* holder = |
2552 static_cast<SessionStorageHolder*>(GetUserData(kSessionStorageHolderKey)); | 2550 static_cast<SessionStorageHolder*>(GetUserData(kSessionStorageHolderKey)); |
2553 if (!holder) | 2551 if (!holder) |
2554 return; | 2552 return; |
2555 holder->Release(old_route_id); | 2553 holder->Release(old_route_id); |
2556 } | 2554 } |
2557 | 2555 |
2558 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | |
2559 bool mhtml_generation_in_renderer_succeeded = data_size >= 0; | |
2560 MHTMLGenerationManager::GetInstance()->OnSavedPageAsMHTML( | |
2561 job_id, mhtml_generation_in_renderer_succeeded); | |
2562 } | |
2563 | |
2564 void RenderProcessHostImpl::OnGpuSwitched() { | 2556 void RenderProcessHostImpl::OnGpuSwitched() { |
2565 // We are updating all widgets including swapped out ones. | 2557 // We are updating all widgets including swapped out ones. |
2566 scoped_ptr<RenderWidgetHostIterator> widgets( | 2558 scoped_ptr<RenderWidgetHostIterator> widgets( |
2567 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); | 2559 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); |
2568 while (RenderWidgetHost* widget = widgets->GetNextHost()) { | 2560 while (RenderWidgetHost* widget = widgets->GetNextHost()) { |
2569 RenderViewHost* rvh = RenderViewHost::From(widget); | 2561 RenderViewHost* rvh = RenderViewHost::From(widget); |
2570 if (!rvh) | 2562 if (!rvh) |
2571 continue; | 2563 continue; |
2572 | 2564 |
2573 // Skip widgets in other processes. | 2565 // Skip widgets in other processes. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 void RenderProcessHostImpl::GetAudioOutputControllers( | 2655 void RenderProcessHostImpl::GetAudioOutputControllers( |
2664 const GetAudioOutputControllersCallback& callback) const { | 2656 const GetAudioOutputControllersCallback& callback) const { |
2665 audio_renderer_host()->GetOutputControllers(callback); | 2657 audio_renderer_host()->GetOutputControllers(callback); |
2666 } | 2658 } |
2667 | 2659 |
2668 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2660 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2669 return bluetooth_dispatcher_host_.get(); | 2661 return bluetooth_dispatcher_host_.get(); |
2670 } | 2662 } |
2671 | 2663 |
2672 } // namespace content | 2664 } // namespace content |
OLD | NEW |