favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/android/
[chromium-blink-merge.git] / content / common / input / touch_event_stream_validator.h
blob95bc10626df3dc9795ad3c78349862413c6aa718
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR_H_
6 #define CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
14 namespace content {
16 // Utility class for validating a stream of WebTouchEvents.
17 class CONTENT_EXPORT TouchEventStreamValidator {
18 public:
19 TouchEventStreamValidator();
20 ~TouchEventStreamValidator();
22 // If |event| is valid for the current stream, returns true.
23 // Otherwise, returns false with a corresponding error message.
24 bool Validate(const blink::WebTouchEvent& event, std::string* error_msg);
26 private:
27 blink::WebTouchEvent previous_event_;
29 DISALLOW_COPY_AND_ASSIGN(TouchEventStreamValidator);
32 } // namespace content
34 #endif // CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR_H_