Chromium Code Reviews| OLD | NEW | 
|---|---|
| 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 #include "content/renderer/input/input_handler_manager.h" | 5 #include "content/renderer/input/input_handler_manager.h" | 
| 6 | 6 | 
| 7 #include <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/location.h" | 10 #include "base/location.h" | 
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 auto it = input_handlers_.find(routing_id); | 137 auto it = input_handlers_.find(routing_id); | 
| 138 if (it == input_handlers_.end()) | 138 if (it == input_handlers_.end()) | 
| 139 return; | 139 return; | 
| 140 | 140 | 
| 141 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 141 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | 
| 142 DCHECK(proxy->scroll_elasticity_controller()); | 142 DCHECK(proxy->scroll_elasticity_controller()); | 
| 143 proxy->scroll_elasticity_controller()->ObserveWheelEventAndResult( | 143 proxy->scroll_elasticity_controller()->ObserveWheelEventAndResult( | 
| 144 wheel_event, scroll_result); | 144 wheel_event, scroll_result); | 
| 145 } | 145 } | 
| 146 | 146 | 
| 147 void InputHandlerManager::ObserveGestureEventAndResultOnMainThread( | |
| 148 int routing_id, | |
| 149 const blink::WebGestureEvent& gesture_event, | |
| 150 const cc::InputHandlerScrollResult& scroll_result) { | |
| 
 
tdresser
2016/03/02 18:26:53
Should we check that we're on the correct thread h
 
dtapuska
2016/03/07 18:03:59
I've added a check in the OnCompositorThread since
 
 | |
| 151 task_runner_->PostTask( | |
| 152 FROM_HERE, | |
| 153 base::Bind( | |
| 154 &InputHandlerManager::ObserveGestureEventAndResultOnCompositorThread, | |
| 155 base::Unretained(this), routing_id, gesture_event, scroll_result)); | |
| 156 } | |
| 157 | |
| 158 void InputHandlerManager::ObserveGestureEventAndResultOnCompositorThread( | |
| 159 int routing_id, | |
| 160 const blink::WebGestureEvent& gesture_event, | |
| 161 const cc::InputHandlerScrollResult& scroll_result) { | |
| 162 auto it = input_handlers_.find(routing_id); | |
| 163 if (it == input_handlers_.end()) | |
| 164 return; | |
| 165 | |
| 166 InputHandlerProxy* proxy = it->second->input_handler_proxy(); | |
| 167 DCHECK(proxy->scroll_elasticity_controller()); | |
| 168 proxy->scroll_elasticity_controller()->ObserveGestureEventAndResult( | |
| 169 gesture_event, scroll_result); | |
| 170 } | |
| 171 | |
| 147 void InputHandlerManager::NonBlockingInputEventHandledOnMainThread( | 172 void InputHandlerManager::NonBlockingInputEventHandledOnMainThread( | 
| 148 int routing_id, | 173 int routing_id, | 
| 149 blink::WebInputEvent::Type type) { | 174 blink::WebInputEvent::Type type) { | 
| 150 task_runner_->PostTask( | 175 task_runner_->PostTask( | 
| 151 FROM_HERE, | 176 FROM_HERE, | 
| 152 base::Bind( | 177 base::Bind( | 
| 153 &InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread, | 178 &InputHandlerManager::NonBlockingInputEventHandledOnCompositorThread, | 
| 154 base::Unretained(this), routing_id, type)); | 179 base::Unretained(this), routing_id, type)); | 
| 155 } | 180 } | 
| 156 | 181 | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 | 235 | 
| 211 void InputHandlerManager::DidStopFlinging(int routing_id) { | 236 void InputHandlerManager::DidStopFlinging(int routing_id) { | 
| 212 client_->DidStopFlinging(routing_id); | 237 client_->DidStopFlinging(routing_id); | 
| 213 } | 238 } | 
| 214 | 239 | 
| 215 void InputHandlerManager::DidAnimateForInput() { | 240 void InputHandlerManager::DidAnimateForInput() { | 
| 216 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 241 renderer_scheduler_->DidAnimateForInputOnCompositorThread(); | 
| 217 } | 242 } | 
| 218 | 243 | 
| 219 } // namespace content | 244 } // namespace content | 
| OLD | NEW |