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

Side by Side Diff: content/common/input/web_input_event_traits.h

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ 5 #ifndef CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_
6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ 6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "content/common/input/did_overscroll_params.h"
12 #include "content/common/input/input_event_ack_state.h"
11 #include "content/common/input/scoped_web_input_event.h" 13 #include "content/common/input/scoped_web_input_event.h"
14 #include "ipc/ipc_message.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h" 15 #include "third_party/WebKit/public/web/WebInputEvent.h"
16 #include "ui/events/latency_info.h"
13 17
14 namespace content { 18 namespace content {
15 19
16 // Utility class for performing operations on and with WebInputEvents. 20 // Utility class for performing operations on and with WebInputEvents.
17 class CONTENT_EXPORT WebInputEventTraits { 21 class CONTENT_EXPORT WebInputEventTraits {
18 public: 22 public:
19 static const char* GetName(blink::WebInputEvent::Type type); 23 static const char* GetName(blink::WebInputEvent::Type type);
20 static std::string ToString(const blink::WebInputEvent& event); 24 static std::string ToString(const blink::WebInputEvent& event);
21 static size_t GetSize(blink::WebInputEvent::Type type); 25 static size_t GetSize(blink::WebInputEvent::Type type);
22 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event); 26 static ScopedWebInputEvent Clone(const blink::WebInputEvent& event);
23 static void Delete(blink::WebInputEvent* event); 27 static void Delete(blink::WebInputEvent* event);
24 static bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce, 28 static bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce,
25 const blink::WebInputEvent& event); 29 const blink::WebInputEvent& event);
26 static void Coalesce(const blink::WebInputEvent& event_to_coalesce, 30 static void Coalesce(const blink::WebInputEvent& event_to_coalesce,
27 blink::WebInputEvent* event); 31 blink::WebInputEvent* event);
28 static bool IgnoresAckDisposition(const blink::WebInputEvent& event); 32 static bool WillReceiveAckFromRenderer(const blink::WebInputEvent& event);
33
34 // Send AsyncTouchEvent_ACK for async touch moves, and InputEvent_ACK for
35 // all other types of events which needs an ack from render.
36 static scoped_ptr<IPC::Message> CreateAckIfNecessary(
37 const blink::WebInputEvent& event,
38 const content::InputEventAckState ack_state,
39 const ui::LatencyInfo& latency_info,
40 scoped_ptr<DidOverscrollParams> overscroll_params,
41 int routing_id);
29 }; 42 };
30 43
31 } // namespace content 44 } // namespace content
32 45
33 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_ 46 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698