Chromium Code Reviews| Index: public/web/WebInputEvent.h |
| diff --git a/public/web/WebInputEvent.h b/public/web/WebInputEvent.h |
| index 3a56faef9d2716540c89a02ed419ae574578cf3a..378d3091a6e0239bcf9ec1101d9df7a1cb1cdd3c 100644 |
| --- a/public/web/WebInputEvent.h |
| +++ b/public/web/WebInputEvent.h |
| @@ -58,15 +58,6 @@ namespace blink { |
| class WebInputEvent { |
| public: |
| - WebInputEvent(unsigned sizeParam = sizeof(WebInputEvent)) |
| - { |
| - memset(this, 0, sizeParam); |
| - timeStampSeconds = 0.0; |
| - size = sizeParam; |
| - type = Undefined; |
| - modifiers = 0; |
| - } |
| - |
| // When we use an input method (or an input method editor), we receive |
| // two events for a keypress. The former event is a keydown, which |
| // provides a keycode, and the latter is a textinput, which provides |
| @@ -224,6 +215,19 @@ public: |
| { |
| return GestureTypeFirst <= type && type <= GestureTypeLast; |
| } |
| + |
| +protected: |
| + explicit WebInputEvent(unsigned sizeParam) |
| + { |
| + memset(this, 0, sizeParam); |
| + timeStampSeconds = 0.0; |
| + size = sizeParam; |
| + type = Undefined; |
| + modifiers = 0; |
| + } |
| + |
| +private: |
| + WebInputEvent(); |
|
tkent
2014/04/02 00:18:52
Is this necessary?
jdduke (slow)
2014/04/02 20:21:00
Nope, removed.
|
| }; |
| // WebKeyboardEvent ----------------------------------------------------------- |
| @@ -274,8 +278,8 @@ public: |
| // This is a string identifying the key pressed. |
| char keyIdentifier[keyIdentifierLengthCap]; |
| - WebKeyboardEvent(unsigned sizeParam = sizeof(WebKeyboardEvent)) |
| - : WebInputEvent(sizeParam) |
| + WebKeyboardEvent() |
| + : WebInputEvent(sizeof(WebKeyboardEvent)) |
| , windowsKeyCode(0) |
| , nativeKeyCode(0) |
| , isSystemKey(false) |
| @@ -315,7 +319,23 @@ public: |
| int movementY; |
| int clickCount; |
| - WebMouseEvent(unsigned sizeParam = sizeof(WebMouseEvent)) |
| + WebMouseEvent() |
| + : WebInputEvent(sizeof(WebMouseEvent)) |
| + , button(ButtonNone) |
| + , x(0) |
| + , y(0) |
| + , windowX(0) |
| + , windowY(0) |
| + , globalX(0) |
| + , globalY(0) |
| + , movementX(0) |
| + , movementY(0) |
| + , clickCount(0) |
| + { |
| + } |
| + |
| +protected: |
| + explicit WebMouseEvent(unsigned sizeParam) |
| : WebInputEvent(sizeParam) |
| , button(ButtonNone) |
| , x(0) |
| @@ -379,8 +399,8 @@ public: |
| int canRubberbandLeft; |
| int canRubberbandRight; |
| - WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent)) |
| - : WebMouseEvent(sizeParam) |
| + WebMouseWheelEvent() |
| + : WebMouseEvent(sizeof(WebMouseWheelEvent)) |
| , deltaX(0.0f) |
| , deltaY(0.0f) |
| , wheelTicksX(0.0f) |
| @@ -465,8 +485,8 @@ public: |
| } pinchUpdate; |
| } data; |
| - WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent)) |
| - : WebInputEvent(sizeParam) |
| + WebGestureEvent() |
| + : WebInputEvent(sizeof(WebGestureEvent)) |
| , x(0) |
| , y(0) |
| , globalX(0) |
| @@ -496,8 +516,8 @@ public: |
| // List of all touches which are currently down and are targeting the event recipient. |
| WebTouchPoint targetTouches[touchesLengthCap]; |
| - WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) |
| - : WebInputEvent(sizeParam) |
| + WebTouchEvent() |
| + : WebInputEvent(sizeof(WebTouchEvent)) |
| , touchesLength(0) |
| , changedTouchesLength(0) |
| , targetTouchesLength(0) |