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/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
22 #include "base/metrics/field_trial.h" | 22 #include "base/metrics/field_trial.h" |
23 #include "base/metrics/histogram_macros.h" | 23 #include "base/metrics/histogram_macros.h" |
24 #include "base/single_thread_task_runner.h" | 24 #include "base/single_thread_task_runner.h" |
25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
27 #include "base/threading/thread_task_runner_handle.h" | 27 #include "base/threading/thread_task_runner_handle.h" |
28 #include "base/trace_event/trace_event.h" | 28 #include "base/trace_event/trace_event.h" |
29 #include "build/build_config.h" | 29 #include "build/build_config.h" |
30 #include "cc/base/switches.h" | 30 #include "cc/base/switches.h" |
| 31 #include "cc/output/begin_frame_args.h" |
31 #include "cc/output/compositor_frame.h" | 32 #include "cc/output/compositor_frame.h" |
32 #include "content/browser/accessibility/accessibility_mode_helper.h" | 33 #include "content/browser/accessibility/accessibility_mode_helper.h" |
33 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 34 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
34 #include "content/browser/bad_message.h" | 35 #include "content/browser/bad_message.h" |
35 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 36 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
36 #include "content/browser/child_process_security_policy_impl.h" | 37 #include "content/browser/child_process_security_policy_impl.h" |
37 #include "content/browser/gpu/compositor_util.h" | 38 #include "content/browser/gpu/compositor_util.h" |
38 #include "content/browser/renderer_host/dip_util.h" | 39 #include "content/browser/renderer_host/dip_util.h" |
39 #include "content/browser/renderer_host/frame_metadata_util.h" | 40 #include "content/browser/renderer_host/frame_metadata_util.h" |
40 #include "content/browser/renderer_host/input/input_router_config_helper.h" | 41 #include "content/browser/renderer_host/input/input_router_config_helper.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 OnQueueSyntheticGesture) | 522 OnQueueSyntheticGesture) |
522 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, | 523 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, |
523 OnImeCancelComposition) | 524 OnImeCancelComposition) |
524 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 525 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
525 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, | 526 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, |
526 OnUpdateScreenRectsAck) | 527 OnUpdateScreenRectsAck) |
527 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 528 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
528 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 529 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
529 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, | 530 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, |
530 OnSwapCompositorFrame(msg)) | 531 OnSwapCompositorFrame(msg)) |
| 532 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginFrameDidNotDraw, |
| 533 OnBeginFrameDidNotDraw) |
531 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 534 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
532 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 535 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
533 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 536 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
534 OnTextInputStateChanged) | 537 OnTextInputStateChanged) |
535 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) | 538 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) |
536 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) | 539 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) |
537 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, | 540 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, |
538 OnShowDisambiguationPopup) | 541 OnShowDisambiguationPopup) |
539 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, | 542 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, |
540 OnSelectionBoundsChanged) | 543 OnSelectionBoundsChanged) |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 ++i) { | 1843 ++i) { |
1841 rph->OnMessageReceived(*i); | 1844 rph->OnMessageReceived(*i); |
1842 if (i->dispatch_error()) | 1845 if (i->dispatch_error()) |
1843 rph->OnBadMessageReceived(*i); | 1846 rph->OnBadMessageReceived(*i); |
1844 } | 1847 } |
1845 messages_to_deliver_with_frame.clear(); | 1848 messages_to_deliver_with_frame.clear(); |
1846 | 1849 |
1847 return true; | 1850 return true; |
1848 } | 1851 } |
1849 | 1852 |
| 1853 void RenderWidgetHostImpl::OnBeginFrameDidNotDraw( |
| 1854 const cc::BeginFrameAck& ack) { |
| 1855 if (view_) |
| 1856 view_->OnBeginFrameDidNotDraw(ack); |
| 1857 } |
| 1858 |
1850 void RenderWidgetHostImpl::OnUpdateRect( | 1859 void RenderWidgetHostImpl::OnUpdateRect( |
1851 const ViewHostMsg_UpdateRect_Params& params) { | 1860 const ViewHostMsg_UpdateRect_Params& params) { |
1852 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); | 1861 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); |
1853 TimeTicks paint_start = TimeTicks::Now(); | 1862 TimeTicks paint_start = TimeTicks::Now(); |
1854 | 1863 |
1855 // Update our knowledge of the RenderWidget's size. | 1864 // Update our knowledge of the RenderWidget's size. |
1856 current_size_ = params.view_size; | 1865 current_size_ = params.view_size; |
1857 | 1866 |
1858 bool is_resize_ack = | 1867 bool is_resize_ack = |
1859 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); | 1868 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 // Note: We are using the origin URL provided by the sender here. It may be | 2507 // Note: We are using the origin URL provided by the sender here. It may be |
2499 // different from the receiver's. | 2508 // different from the receiver's. |
2500 file_system_file.url = | 2509 file_system_file.url = |
2501 GURL(storage::GetIsolatedFileSystemRootURIString( | 2510 GURL(storage::GetIsolatedFileSystemRootURIString( |
2502 file_system_url.origin(), filesystem_id, std::string()) | 2511 file_system_url.origin(), filesystem_id, std::string()) |
2503 .append(register_name)); | 2512 .append(register_name)); |
2504 } | 2513 } |
2505 } | 2514 } |
2506 | 2515 |
2507 } // namespace content | 2516 } // namespace content |
OLD | NEW |