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

Unified Diff: content/common/input/gesture_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/gesture_event_stream_validator.h
diff --git a/content/common/input/gesture_event_stream_validator.h b/content/common/input/gesture_event_stream_validator.h
index 7592ca907b045794afea032dd3e2930525838a3a..3c417f5d425f339cc1c71054b072f511a9e251e5 100644
--- a/content/common/input/gesture_event_stream_validator.h
+++ b/content/common/input/gesture_event_stream_validator.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
#define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
+#include <string>
+
#include "base/basictypes.h"
namespace blink {
@@ -13,15 +15,15 @@ class WebGestureEvent;
namespace content {
-// In debug mode, logs an error and exits if the stream of WebGestureEvents
-// passed to Validate is invalid.
+// Utility class for validating a stream of WebGestureEvents.
class GestureEventStreamValidator {
public:
GestureEventStreamValidator();
~GestureEventStreamValidator();
- // Returns true iff |event| is valid for the current stream.
- bool Validate(const blink::WebGestureEvent& event,
- const char** error_message);
+
+ // If |event| is valid for the current stream, returns true.
+ // Otherwise, returns false with a corresponding error message.
+ bool Validate(const blink::WebGestureEvent& event, std::string* error_msg);
private:
bool scrolling_;

Powered by Google App Engine
This is Rietveld 408576698