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

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

Issue 628763003: Support InputRouter recycling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_EVENT_STREAM_VALIDATOR 5 #ifndef CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
6 #define CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR 6 #define CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/common/input/gesture_event_stream_validator.h" 10 #include "content/common/input/gesture_event_stream_validator.h"
11 #include "content/common/input/touch_event_stream_validator.h" 11 #include "content/common/input/touch_event_stream_validator.h"
12 12
13 namespace blink { 13 namespace blink {
14 class WebInputEvent; 14 class WebInputEvent;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 18
19 // DCHECKs that the stream of WebInputEvents passed to OnEvent is 19 // CHECKs that the stream of WebInputEvents passed to OnEvent is
20 // valid. Currently only validates touch and touchscreen gesture events. 20 // valid. Currently only validates touch and touchscreen gesture events.
21 class InputEventStreamValidator { 21 class InputEventStreamValidator {
22 public: 22 public:
23 InputEventStreamValidator(); 23 InputEventStreamValidator();
24 ~InputEventStreamValidator(); 24 ~InputEventStreamValidator();
25 25
26 void Validate(const blink::WebInputEvent&); 26 void Validate(const blink::WebInputEvent&);
27 27
28 private: 28 private:
29 bool ValidateImpl(const blink::WebInputEvent&, std::string* error_msg); 29 bool ValidateImpl(const blink::WebInputEvent&, std::string* error_msg);
30 30
31 GestureEventStreamValidator gesture_validator_; 31 GestureEventStreamValidator gesture_validator_;
32 TouchEventStreamValidator touch_validator_; 32 TouchEventStreamValidator touch_validator_;
33 std::string error_msg_; 33 std::string error_msg_;
34 const bool enabled_; 34 const bool enabled_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(InputEventStreamValidator); 36 DISALLOW_COPY_AND_ASSIGN(InputEventStreamValidator);
37 }; 37 };
38 38
39 } // namespace content 39 } // namespace content
40 40
41 #endif // CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR 41 #endif // CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698