| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 namespace { | 63 namespace { |
| 64 | 64 |
| 65 // How long to (synchronously) wait for the renderer to respond with a | 65 // How long to (synchronously) wait for the renderer to respond with a |
| 66 // PaintRect message, when our backing-store is invalid, before giving up and | 66 // PaintRect message, when our backing-store is invalid, before giving up and |
| 67 // returning a null or incorrectly sized backing-store from GetBackingStore. | 67 // returning a null or incorrectly sized backing-store from GetBackingStore. |
| 68 // This timeout impacts the "choppiness" of our window resize perf. | 68 // This timeout impacts the "choppiness" of our window resize perf. |
| 69 static const int kPaintMsgTimeoutMS = 50; | 69 static const int kPaintMsgTimeoutMS = 50; |
| 70 | 70 |
| 71 // How long to wait before we consider a renderer hung. | 71 // How long to wait before we consider a renderer hung. |
| 72 static const int kHungRendererDelayMs = 20000; | 72 static const int kHungRendererDelayMs = 30000; |
| 73 | 73 |
| 74 // Returns |true| if the two wheel events should be coalesced. | 74 // Returns |true| if the two wheel events should be coalesced. |
| 75 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, | 75 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, |
| 76 const WebMouseWheelEvent& new_event) { | 76 const WebMouseWheelEvent& new_event) { |
| 77 return last_event.modifiers == new_event.modifiers && | 77 return last_event.modifiers == new_event.modifiers && |
| 78 last_event.scrollByPage == new_event.scrollByPage && | 78 last_event.scrollByPage == new_event.scrollByPage && |
| 79 last_event.hasPreciseScrollingDeltas | 79 last_event.hasPreciseScrollingDeltas |
| 80 == new_event.hasPreciseScrollingDeltas && | 80 == new_event.hasPreciseScrollingDeltas && |
| 81 last_event.phase == new_event.phase && | 81 last_event.phase == new_event.phase && |
| 82 last_event.momentumPhase == new_event.momentumPhase; | 82 last_event.momentumPhase == new_event.momentumPhase; |
| (...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 // indicate that no callback is in progress (i.e. without this line | 1834 // indicate that no callback is in progress (i.e. without this line |
| 1835 // DelayedAutoResized will not get called again). | 1835 // DelayedAutoResized will not get called again). |
| 1836 new_auto_size_.SetSize(0, 0); | 1836 new_auto_size_.SetSize(0, 0); |
| 1837 if (!should_auto_resize_) | 1837 if (!should_auto_resize_) |
| 1838 return; | 1838 return; |
| 1839 | 1839 |
| 1840 OnRenderAutoResized(new_size); | 1840 OnRenderAutoResized(new_size); |
| 1841 } | 1841 } |
| 1842 | 1842 |
| 1843 } // namespace content | 1843 } // namespace content |
| OLD | NEW |