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

Side by Side Diff: content/renderer/input/input_handler_manager.h

Issue 2166703003: Implement Main Thread RAF Aligned Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_main_thread_queue
Patch Set: Clean prototype up Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_
7 7
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 23 matching lines...) Expand all
34 34
35 namespace ui { 35 namespace ui {
36 struct DidOverscrollParams; 36 struct DidOverscrollParams;
37 } 37 }
38 38
39 namespace content { 39 namespace content {
40 40
41 class InputHandlerWrapper; 41 class InputHandlerWrapper;
42 class SynchronousInputHandlerProxyClient; 42 class SynchronousInputHandlerProxyClient;
43 class InputHandlerManagerClient; 43 class InputHandlerManagerClient;
44 struct DidOverscrollParams;
45 44
46 // InputHandlerManager class manages InputHandlerProxy instances for 45 // InputHandlerManager class manages InputHandlerProxy instances for
47 // the WebViews in this renderer. 46 // the WebViews in this renderer.
48 class CONTENT_EXPORT InputHandlerManager { 47 class CONTENT_EXPORT InputHandlerManager {
49 public: 48 public:
50 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The 49 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The
51 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| 50 // underlying MessageLoop and supplied |client| and the |renderer_scheduler|
52 // must outlive this object. The RendererScheduler needs to know when input 51 // must outlive this object. The RendererScheduler needs to know when input
53 // events and fling animations occur, which is why it's passed in here. 52 // events and fling animations occur, which is why it's passed in here.
54 InputHandlerManager( 53 InputHandlerManager(
(...skipping 13 matching lines...) Expand all
68 void UnregisterRoutingID(int routing_id); 67 void UnregisterRoutingID(int routing_id);
69 68
70 void ObserveGestureEventAndResultOnMainThread( 69 void ObserveGestureEventAndResultOnMainThread(
71 int routing_id, 70 int routing_id,
72 const blink::WebGestureEvent& gesture_event, 71 const blink::WebGestureEvent& gesture_event,
73 const cc::InputHandlerScrollResult& scroll_result); 72 const cc::InputHandlerScrollResult& scroll_result);
74 73
75 void NotifyInputEventHandledOnMainThread(int routing_id, 74 void NotifyInputEventHandledOnMainThread(int routing_id,
76 blink::WebInputEvent::Type, 75 blink::WebInputEvent::Type,
77 InputEventAckState); 76 InputEventAckState);
77 void ProcessRafAlignedInputOnMainThread(int routing_id);
78 78
79 // Callback only from the compositor's thread. 79 // Callback only from the compositor's thread.
80 void RemoveInputHandler(int routing_id); 80 void RemoveInputHandler(int routing_id);
81 81
82 // Called from the compositor's thread. 82 // Called from the compositor's thread.
83 virtual InputEventAckState HandleInputEvent( 83 virtual InputEventAckState HandleInputEvent(
84 int routing_id, 84 int routing_id,
85 const blink::WebInputEvent* input_event, 85 const blink::WebInputEvent* input_event,
86 ui::LatencyInfo* latency_info); 86 ui::LatencyInfo* latency_info);
87 87
88 // Called from the compositor's thread. 88 // Called from the compositor's thread.
89 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); 89 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params);
90 90
91 // Called from the compositor's thread. 91 // Called from the compositor's thread.
92 void DidStartFlinging(int routing_id); 92 void DidStartFlinging(int routing_id);
93 void DidStopFlinging(int routing_id); 93 void DidStopFlinging(int routing_id);
94 94
95 // Called from the compositor's thread. 95 // Called from the compositor's thread.
96 void DidAnimateForInput(); 96 void DidAnimateForInput();
97 97
98 // Called from the compositor's thread.
99 void NeedsMainFrame(int routing_id);
100
98 private: 101 private:
99 // Called from the compositor's thread. 102 // Called from the compositor's thread.
100 void AddInputHandlerOnCompositorThread( 103 void AddInputHandlerOnCompositorThread(
101 int routing_id, 104 int routing_id,
102 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, 105 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
103 const base::WeakPtr<cc::InputHandler>& input_handler, 106 const base::WeakPtr<cc::InputHandler>& input_handler,
104 const base::WeakPtr<RenderViewImpl>& render_view_impl, 107 const base::WeakPtr<RenderViewImpl>& render_view_impl,
105 bool enable_smooth_scrolling); 108 bool enable_smooth_scrolling);
106 109
107 void RegisterRoutingIDOnCompositorThread(int routing_id); 110 void RegisterRoutingIDOnCompositorThread(int routing_id);
(...skipping 17 matching lines...) Expand all
125 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 128 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
126 InputHandlerManagerClient* const client_; 129 InputHandlerManagerClient* const client_;
127 // May be null. 130 // May be null.
128 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; 131 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_;
129 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. 132 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned.
130 }; 133 };
131 134
132 } // namespace content 135 } // namespace content
133 136
134 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ 137 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698