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

Unified Diff: content/common/input/touch_event_stream_validator.h

Issue 290473006: Add a TouchEventStreamValidator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/common/input/touch_event_stream_validator.h
diff --git a/content/common/input/touch_event_stream_validator.h b/content/common/input/touch_event_stream_validator.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c9732cedfd35e896eb45335d5e7a6c372dba284
--- /dev/null
+++ b/content/common/input/touch_event_stream_validator.h
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR
+#define CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
+
+namespace content {
+
+// Utility class for validating a stream of WebTouchEvents.
+class TouchEventStreamValidator {
+ public:
+ TouchEventStreamValidator();
+ ~TouchEventStreamValidator();
+
+ // If |event| is valid for the current stream, returns true.
+ // Otherwise, returns false with a corresponding error message.
+ bool Validate(const blink::WebTouchEvent& event, std::string* error_msg);
+
+ private:
+ blink::WebTouchEvent previous_event_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchEventStreamValidator);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_INPUT_TOUCH_EVENT_STREAM_VALIDATOR
« no previous file with comments | « content/common/input/input_event_stream_validator.cc ('k') | content/common/input/touch_event_stream_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698