| 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 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 // support asynchronous painting, this is equivalent to | 1988 // support asynchronous painting, this is equivalent to |
| 1989 // MPArch.RWH_TotalPaintTime. | 1989 // MPArch.RWH_TotalPaintTime. |
| 1990 TimeDelta delta = TimeTicks::Now() - paint_start; | 1990 TimeDelta delta = TimeTicks::Now() - paint_start; |
| 1991 UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta); | 1991 UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta); |
| 1992 } | 1992 } |
| 1993 | 1993 |
| 1994 void RenderWidgetHostImpl::DidUpdateBackingStore( | 1994 void RenderWidgetHostImpl::DidUpdateBackingStore( |
| 1995 const ViewHostMsg_UpdateRect_Params& params, | 1995 const ViewHostMsg_UpdateRect_Params& params, |
| 1996 const TimeTicks& paint_start) { | 1996 const TimeTicks& paint_start) { |
| 1997 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::DidUpdateBackingStore"); | 1997 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::DidUpdateBackingStore"); |
| 1998 TimeTicks update_start = TimeTicks::Now(); | |
| 1999 | 1998 |
| 2000 NotificationService::current()->Notify( | 1999 NotificationService::current()->Notify( |
| 2001 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, | 2000 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, |
| 2002 Source<RenderWidgetHost>(this), | 2001 Source<RenderWidgetHost>(this), |
| 2003 NotificationService::NoDetails()); | 2002 NotificationService::NoDetails()); |
| 2004 | 2003 |
| 2005 // We don't need to update the view if the view is hidden. We must do this | 2004 // We don't need to update the view if the view is hidden. We must do this |
| 2006 // early return after the ACK is sent, however, or the renderer will not send | 2005 // early return after the ACK is sent, however, or the renderer will not send |
| 2007 // us more data. | 2006 // us more data. |
| 2008 if (is_hidden_) | 2007 if (is_hidden_) |
| 2009 return; | 2008 return; |
| 2010 | 2009 |
| 2011 // If we got a resize ack, then perhaps we have another resize to send? | 2010 // If we got a resize ack, then perhaps we have another resize to send? |
| 2012 bool is_resize_ack = | 2011 bool is_resize_ack = |
| 2013 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); | 2012 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); |
| 2014 if (is_resize_ack) | 2013 if (is_resize_ack) |
| 2015 WasResized(); | 2014 WasResized(); |
| 2016 | |
| 2017 // Log the time delta for processing a paint message. | |
| 2018 TimeTicks now = TimeTicks::Now(); | |
| 2019 TimeDelta delta = now - update_start; | |
| 2020 UMA_HISTOGRAM_TIMES("MPArch.RWH_DidUpdateBackingStore", delta); | |
| 2021 } | 2015 } |
| 2022 | 2016 |
| 2023 void RenderWidgetHostImpl::OnQueueSyntheticGesture( | 2017 void RenderWidgetHostImpl::OnQueueSyntheticGesture( |
| 2024 const SyntheticGesturePacket& gesture_packet) { | 2018 const SyntheticGesturePacket& gesture_packet) { |
| 2025 // Only allow untrustworthy gestures if explicitly enabled. | 2019 // Only allow untrustworthy gestures if explicitly enabled. |
| 2026 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 2020 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2027 cc::switches::kEnableGpuBenchmarking)) { | 2021 cc::switches::kEnableGpuBenchmarking)) { |
| 2028 bad_message::ReceivedBadMessage(GetProcess(), | 2022 bad_message::ReceivedBadMessage(GetProcess(), |
| 2029 bad_message::RWH_SYNTHETIC_GESTURE); | 2023 bad_message::RWH_SYNTHETIC_GESTURE); |
| 2030 return; | 2024 return; |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2657 RenderProcessHost* rph = GetProcess(); | 2651 RenderProcessHost* rph = GetProcess(); |
| 2658 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); | 2652 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
| 2659 i != messages.end(); ++i) { | 2653 i != messages.end(); ++i) { |
| 2660 rph->OnMessageReceived(*i); | 2654 rph->OnMessageReceived(*i); |
| 2661 if (i->dispatch_error()) | 2655 if (i->dispatch_error()) |
| 2662 rph->OnBadMessageReceived(*i); | 2656 rph->OnBadMessageReceived(*i); |
| 2663 } | 2657 } |
| 2664 } | 2658 } |
| 2665 | 2659 |
| 2666 } // namespace content | 2660 } // namespace content |
| OLD | NEW |