| 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 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 last_received_content_source_id_ = frame.metadata.content_source_id; | 1871 last_received_content_source_id_ = frame.metadata.content_source_id; |
| 1872 | 1872 |
| 1873 if (frame.metadata.begin_frame_ack.sequence_number < | 1873 if (frame.metadata.begin_frame_ack.sequence_number < |
| 1874 cc::BeginFrameArgs::kStartingFrameNumber) { | 1874 cc::BeginFrameArgs::kStartingFrameNumber) { |
| 1875 // Received an invalid ack, renderer misbehaved. | 1875 // Received an invalid ack, renderer misbehaved. |
| 1876 bad_message::ReceivedBadMessage( | 1876 bad_message::ReceivedBadMessage( |
| 1877 GetProcess(), | 1877 GetProcess(), |
| 1878 bad_message::RWH_INVALID_BEGIN_FRAME_ACK_COMPOSITOR_FRAME); | 1878 bad_message::RWH_INVALID_BEGIN_FRAME_ACK_COMPOSITOR_FRAME); |
| 1879 return false; | 1879 return false; |
| 1880 } | 1880 } |
| 1881 // |has_damage| and |remaining_frames| are not transmitted. | 1881 // |has_damage| is not transmitted. |
| 1882 frame.metadata.begin_frame_ack.has_damage = true; | 1882 frame.metadata.begin_frame_ack.has_damage = true; |
| 1883 frame.metadata.begin_frame_ack.remaining_frames = 0; | |
| 1884 | 1883 |
| 1885 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, | 1884 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, |
| 1886 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { | 1885 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { |
| 1887 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); | 1886 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); |
| 1888 } | 1887 } |
| 1889 | 1888 |
| 1890 latency_tracker_.OnSwapCompositorFrame(&frame.metadata.latency_info); | 1889 latency_tracker_.OnSwapCompositorFrame(&frame.metadata.latency_info); |
| 1891 | 1890 |
| 1892 bool is_mobile_optimized = IsMobileOptimizedFrame(frame.metadata); | 1891 bool is_mobile_optimized = IsMobileOptimizedFrame(frame.metadata); |
| 1893 input_router_->NotifySiteIsMobileOptimized(is_mobile_optimized); | 1892 input_router_->NotifySiteIsMobileOptimized(is_mobile_optimized); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 | 1934 |
| 1936 void RenderWidgetHostImpl::OnBeginFrameDidNotSwap( | 1935 void RenderWidgetHostImpl::OnBeginFrameDidNotSwap( |
| 1937 const cc::BeginFrameAck& ack) { | 1936 const cc::BeginFrameAck& ack) { |
| 1938 if (ack.sequence_number < cc::BeginFrameArgs::kStartingFrameNumber) { | 1937 if (ack.sequence_number < cc::BeginFrameArgs::kStartingFrameNumber) { |
| 1939 // Received an invalid ack, renderer misbehaved. | 1938 // Received an invalid ack, renderer misbehaved. |
| 1940 bad_message::ReceivedBadMessage( | 1939 bad_message::ReceivedBadMessage( |
| 1941 GetProcess(), bad_message::RWH_INVALID_BEGIN_FRAME_ACK_DID_NOT_SWAP); | 1940 GetProcess(), bad_message::RWH_INVALID_BEGIN_FRAME_ACK_DID_NOT_SWAP); |
| 1942 return; | 1941 return; |
| 1943 } | 1942 } |
| 1944 | 1943 |
| 1945 // |has_damage| and |remaining_frames| are not transmitted. | 1944 // |has_damage| is not transmitted. |
| 1946 cc::BeginFrameAck modified_ack = ack; | 1945 cc::BeginFrameAck modified_ack = ack; |
| 1947 modified_ack.has_damage = false; | 1946 modified_ack.has_damage = false; |
| 1948 modified_ack.remaining_frames = 0; | |
| 1949 | 1947 |
| 1950 if (view_) | 1948 if (view_) |
| 1951 view_->OnBeginFrameDidNotSwap(modified_ack); | 1949 view_->OnBeginFrameDidNotSwap(modified_ack); |
| 1952 } | 1950 } |
| 1953 | 1951 |
| 1954 void RenderWidgetHostImpl::OnUpdateRect( | 1952 void RenderWidgetHostImpl::OnUpdateRect( |
| 1955 const ViewHostMsg_UpdateRect_Params& params) { | 1953 const ViewHostMsg_UpdateRect_Params& params) { |
| 1956 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); | 1954 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); |
| 1957 TimeTicks paint_start = TimeTicks::Now(); | 1955 TimeTicks paint_start = TimeTicks::Now(); |
| 1958 | 1956 |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 void RenderWidgetHostImpl::RequestCompositionUpdates(bool immediate_request, | 2648 void RenderWidgetHostImpl::RequestCompositionUpdates(bool immediate_request, |
| 2651 bool monitor_updates) { | 2649 bool monitor_updates) { |
| 2652 if (!immediate_request && monitor_updates == monitoring_composition_info_) | 2650 if (!immediate_request && monitor_updates == monitoring_composition_info_) |
| 2653 return; | 2651 return; |
| 2654 monitoring_composition_info_ = monitor_updates; | 2652 monitoring_composition_info_ = monitor_updates; |
| 2655 Send(new InputMsg_RequestCompositionUpdates(routing_id_, immediate_request, | 2653 Send(new InputMsg_RequestCompositionUpdates(routing_id_, immediate_request, |
| 2656 monitor_updates)); | 2654 monitor_updates)); |
| 2657 } | 2655 } |
| 2658 | 2656 |
| 2659 } // namespace content | 2657 } // namespace content |
| OLD | NEW |