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 // 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 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 bool msg_is_ok = true; | 895 bool msg_is_ok = true; |
896 IPC_BEGIN_MESSAGE_MAP_EX(RenderProcessHostImpl, msg, msg_is_ok) | 896 IPC_BEGIN_MESSAGE_MAP_EX(RenderProcessHostImpl, msg, msg_is_ok) |
897 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, | 897 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, |
898 OnShutdownRequest) | 898 OnShutdownRequest) |
899 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_DumpHandlesDone, | 899 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_DumpHandlesDone, |
900 OnDumpHandlesDone) | 900 OnDumpHandlesDone) |
901 IPC_MESSAGE_HANDLER(ViewHostMsg_SuddenTerminationChanged, | 901 IPC_MESSAGE_HANDLER(ViewHostMsg_SuddenTerminationChanged, |
902 SuddenTerminationChanged) | 902 SuddenTerminationChanged) |
903 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, | 903 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, |
904 OnUserMetricsRecordAction) | 904 OnUserMetricsRecordAction) |
| 905 IPC_MESSAGE_HANDLER(ViewHostMsg_SyncIPCElapsedTime, |
| 906 OnSyncIPCElapsedTime) |
905 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) | 907 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) |
906 // Adding single handlers for your service here is fine, but once your | 908 // Adding single handlers for your service here is fine, but once your |
907 // service needs more than one handler, please extract them into a new | 909 // service needs more than one handler, please extract them into a new |
908 // message filter and add that filter to CreateMessageFilters(). | 910 // message filter and add that filter to CreateMessageFilters(). |
909 IPC_MESSAGE_UNHANDLED_ERROR() | 911 IPC_MESSAGE_UNHANDLED_ERROR() |
910 IPC_END_MESSAGE_MAP_EX() | 912 IPC_END_MESSAGE_MAP_EX() |
911 | 913 |
912 if (!msg_is_ok) { | 914 if (!msg_is_ok) { |
913 // The message had a handler, but its de-serialization failed. | 915 // The message had a handler, but its de-serialization failed. |
914 // We consider this a capital crime. Kill the renderer if we have one. | 916 // We consider this a capital crime. Kill the renderer if we have one. |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 Send(queued_messages_.front()); | 1361 Send(queued_messages_.front()); |
1360 queued_messages_.pop(); | 1362 queued_messages_.pop(); |
1361 } | 1363 } |
1362 } | 1364 } |
1363 | 1365 |
1364 void RenderProcessHostImpl::OnUserMetricsRecordAction( | 1366 void RenderProcessHostImpl::OnUserMetricsRecordAction( |
1365 const std::string& action) { | 1367 const std::string& action) { |
1366 content::RecordComputedAction(action); | 1368 content::RecordComputedAction(action); |
1367 } | 1369 } |
1368 | 1370 |
| 1371 void RenderProcessHostImpl::OnSyncIPCElapsedTime(const base::TimeDelta& delta) { |
| 1372 HISTOGRAM_TIMES("RendererSyncIPC.ElapsedTime", delta); |
| 1373 } |
| 1374 |
1369 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1375 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1370 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); | 1376 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); |
1371 } | 1377 } |
1372 | 1378 |
1373 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( | 1379 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( |
1374 int32 surface_id, | 1380 int32 surface_id, |
1375 uint64 surface_handle, | 1381 uint64 surface_handle, |
1376 int32 route_id, | 1382 int32 route_id, |
1377 int32 gpu_process_host_id) { | 1383 int32 gpu_process_host_id) { |
1378 TRACE_EVENT0("renderer_host", | 1384 TRACE_EVENT0("renderer_host", |
1379 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1385 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1380 RenderWidgetHostImpl::AcknowledgeSwapBuffers(route_id, | 1386 RenderWidgetHostImpl::AcknowledgeSwapBuffers(route_id, |
1381 gpu_process_host_id); | 1387 gpu_process_host_id); |
1382 } | 1388 } |
OLD | NEW |