Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: content/renderer/render_widget.cc

Issue 2713093005: Teach MainThreadEventQueue about touchmove throttling. (Closed)
Patch Set: Roll if/else condition together Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/input/main_thread_event_queue_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #include "third_party/WebKit/public/web/WebNode.h" 84 #include "third_party/WebKit/public/web/WebNode.h"
85 #include "third_party/WebKit/public/web/WebPagePopup.h" 85 #include "third_party/WebKit/public/web/WebPagePopup.h"
86 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" 86 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h"
87 #include "third_party/WebKit/public/web/WebRange.h" 87 #include "third_party/WebKit/public/web/WebRange.h"
88 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 88 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
89 #include "third_party/WebKit/public/web/WebView.h" 89 #include "third_party/WebKit/public/web/WebView.h"
90 #include "third_party/WebKit/public/web/WebWidget.h" 90 #include "third_party/WebKit/public/web/WebWidget.h"
91 #include "third_party/skia/include/core/SkShader.h" 91 #include "third_party/skia/include/core/SkShader.h"
92 #include "ui/base/clipboard/clipboard.h" 92 #include "ui/base/clipboard/clipboard.h"
93 #include "ui/base/ui_base_switches.h" 93 #include "ui/base/ui_base_switches.h"
94 #include "ui/events/base_event_utils.h"
94 #include "ui/gfx/geometry/point_conversions.h" 95 #include "ui/gfx/geometry/point_conversions.h"
95 #include "ui/gfx/geometry/rect_conversions.h" 96 #include "ui/gfx/geometry/rect_conversions.h"
96 #include "ui/gfx/geometry/size_conversions.h" 97 #include "ui/gfx/geometry/size_conversions.h"
97 #include "ui/gfx/skia_util.h" 98 #include "ui/gfx/skia_util.h"
98 #include "ui/gl/gl_switches.h" 99 #include "ui/gl/gl_switches.h"
99 #include "ui/surface/transport_dib.h" 100 #include "ui/surface/transport_dib.h"
100 101
101 #if defined(OS_ANDROID) 102 #if defined(OS_ANDROID)
102 #include <android/keycodes.h> 103 #include <android/keycodes.h>
103 #include "base/time/time.h" 104 #include "base/time/time.h"
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 elastic_overscroll_delta, page_scale, 868 elastic_overscroll_delta, page_scale,
868 top_controls_delta); 869 top_controls_delta);
869 } 870 }
870 871
871 void RenderWidget::BeginMainFrame(double frame_time_sec) { 872 void RenderWidget::BeginMainFrame(double frame_time_sec) {
872 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 873 RenderThreadImpl* render_thread = RenderThreadImpl::current();
873 // render_thread may be NULL in tests. 874 // render_thread may be NULL in tests.
874 InputHandlerManager* input_handler_manager = 875 InputHandlerManager* input_handler_manager =
875 render_thread ? render_thread->input_handler_manager() : NULL; 876 render_thread ? render_thread->input_handler_manager() : NULL;
876 if (input_handler_manager) 877 if (input_handler_manager)
877 input_handler_manager->ProcessRafAlignedInputOnMainThread(routing_id_); 878 input_handler_manager->ProcessRafAlignedInputOnMainThread(
879 routing_id_, ui::EventTimeStampFromSeconds(frame_time_sec));
878 880
879 GetWebWidget()->beginFrame(frame_time_sec); 881 GetWebWidget()->beginFrame(frame_time_sec);
880 } 882 }
881 883
882 std::unique_ptr<cc::CompositorFrameSink> 884 std::unique_ptr<cc::CompositorFrameSink>
883 RenderWidget::CreateCompositorFrameSink(const cc::FrameSinkId& frame_sink_id, 885 RenderWidget::CreateCompositorFrameSink(const cc::FrameSinkId& frame_sink_id,
884 bool fallback) { 886 bool fallback) {
885 DCHECK(GetWebWidget()); 887 DCHECK(GetWebWidget());
886 // For widgets that are never visible, we don't start the compositor, so we 888 // For widgets that are never visible, we don't start the compositor, so we
887 // never get a request for a cc::CompositorFrameSink. 889 // never get a request for a cc::CompositorFrameSink.
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 // browser side (https://crbug.com/669219). 2312 // browser side (https://crbug.com/669219).
2311 // If there is no WebFrameWidget, then there will be no 2313 // If there is no WebFrameWidget, then there will be no
2312 // InputMethodControllers for a WebLocalFrame. 2314 // InputMethodControllers for a WebLocalFrame.
2313 return nullptr; 2315 return nullptr;
2314 } 2316 }
2315 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2317 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2316 ->getActiveWebInputMethodController(); 2318 ->getActiveWebInputMethodController();
2317 } 2319 }
2318 2320
2319 } // namespace content 2321 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/main_thread_event_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698