Title: [260933] trunk/Source
Revision
260933
Author
[email protected]
Date
2020-04-29 21:16:00 -0700 (Wed, 29 Apr 2020)

Log Message

Use initializers in PlatformMouseEvent and WebEvent
https://bugs.webkit.org/show_bug.cgi?id=211217

Reviewed by Tim Horton.

Source/WebCore:

Use initializers im PlatformMouseEvent.

* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):

Source/WebKit:

Use initializers im WebEvent.

* Shared/WebEvent.h:
* Shared/WebMouseEvent.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260932 => 260933)


--- trunk/Source/WebCore/ChangeLog	2020-04-30 03:03:17 UTC (rev 260932)
+++ trunk/Source/WebCore/ChangeLog	2020-04-30 04:16:00 UTC (rev 260933)
@@ -1,3 +1,15 @@
+2020-04-29  Simon Fraser  <[email protected]>
+
+        Use initializers in PlatformMouseEvent and WebEvent
+        https://bugs.webkit.org/show_bug.cgi?id=211217
+
+        Reviewed by Tim Horton.
+
+        Use initializers im PlatformMouseEvent.
+
+        * platform/PlatformMouseEvent.h:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+
 2020-04-29  Jer Noble  <[email protected]>
 
         Remove the debug ASSERT in ImageDecoderAVFObjC::storeSampleBuffer()

Modified: trunk/Source/WebCore/platform/PlatformMouseEvent.h (260932 => 260933)


--- trunk/Source/WebCore/platform/PlatformMouseEvent.h	2020-04-30 03:03:17 UTC (rev 260932)
+++ trunk/Source/WebCore/platform/PlatformMouseEvent.h	2020-04-30 04:16:00 UTC (rev 260933)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef PlatformMouseEvent_h
-#define PlatformMouseEvent_h
+#pragma once
 
 #include "IntPoint.h"
 #include "PlatformEvent.h"
@@ -46,15 +45,6 @@
     public:
         PlatformMouseEvent()
             : PlatformEvent(PlatformEvent::MouseMoved)
-            , m_button(NoButton)
-            , m_clickCount(0)
-            , m_modifierFlags(0)
-#if PLATFORM(MAC)
-            , m_eventNumber(0)
-            , m_menuTypeForEvent(0)
-#elif PLATFORM(WIN)
-            , m_didActivateWebView(false)
-#endif
         {
         }
 
@@ -65,16 +55,9 @@
             , m_globalPosition(globalPosition)
             , m_button(button)
             , m_clickCount(clickCount)
-            , m_modifierFlags(0)
             , m_force(force)
             , m_syntheticClickType(syntheticClickType)
             , m_pointerId(pointerId)
-#if PLATFORM(MAC)
-            , m_eventNumber(0)
-            , m_menuTypeForEvent(0)
-#elif PLATFORM(WIN)
-            , m_didActivateWebView(false)
-#endif
         {
         }
 
@@ -109,19 +92,19 @@
 #if ENABLE(POINTER_LOCK)
         IntPoint m_movementDelta;
 #endif
-        MouseButton m_button;
+        MouseButton m_button { NoButton };
         unsigned short m_buttons { 0 };
-        int m_clickCount;
-        unsigned m_modifierFlags;
+        int m_clickCount { 0 };
+        unsigned m_modifierFlags { 0 };
         double m_force { 0 };
         SyntheticClickType m_syntheticClickType { NoTap };
         PointerID m_pointerId { mousePointerID };
 
 #if PLATFORM(MAC)
-        int m_eventNumber;
-        int m_menuTypeForEvent;
+        int m_eventNumber { 0 };
+        int m_menuTypeForEvent { 0 };
 #elif PLATFORM(WIN)
-        bool m_didActivateWebView;
+        bool m_didActivateWebView { false };
 #endif
     };
 
@@ -140,5 +123,3 @@
 #endif
 
 } // namespace WebCore
-
-#endif // PlatformMouseEvent_h

Modified: trunk/Source/WebKit/ChangeLog (260932 => 260933)


--- trunk/Source/WebKit/ChangeLog	2020-04-30 03:03:17 UTC (rev 260932)
+++ trunk/Source/WebKit/ChangeLog	2020-04-30 04:16:00 UTC (rev 260933)
@@ -1,3 +1,15 @@
+2020-04-29  Simon Fraser  <[email protected]>
+
+        Use initializers in PlatformMouseEvent and WebEvent
+        https://bugs.webkit.org/show_bug.cgi?id=211217
+
+        Reviewed by Tim Horton.
+
+        Use initializers im WebEvent.
+
+        * Shared/WebEvent.h:
+        * Shared/WebMouseEvent.cpp:
+
 2020-04-29  Brent Fulgham  <[email protected]>
 
         Improve SandboxExtension::HandleArray to reduce boilerplate

Modified: trunk/Source/WebKit/Shared/WebEvent.h (260932 => 260933)


--- trunk/Source/WebKit/Shared/WebEvent.h	2020-04-30 03:03:17 UTC (rev 260932)
+++ trunk/Source/WebKit/Shared/WebEvent.h	2020-04-30 04:16:00 UTC (rev 260933)
@@ -166,17 +166,17 @@
 private:
     static bool isMouseEventType(Type);
 
-    uint32_t m_button;
+    uint32_t m_button { static_cast<uint32_t>(NoButton) };
     unsigned short m_buttons { 0 };
     WebCore::IntPoint m_position;
     WebCore::IntPoint m_globalPosition;
-    float m_deltaX;
-    float m_deltaY;
-    float m_deltaZ;
-    int32_t m_clickCount;
+    float m_deltaX { 0 };
+    float m_deltaY { 0 };
+    float m_deltaZ { 0 };
+    int32_t m_clickCount { 0 };
 #if PLATFORM(MAC)
-    int32_t m_eventNumber;
-    int32_t m_menuTypeForEvent;
+    int32_t m_eventNumber { -1 };
+    int32_t m_menuTypeForEvent { 0 };
 #endif
     double m_force { 0 };
     uint32_t m_syntheticClickType { NoTap };

Modified: trunk/Source/WebKit/Shared/WebMouseEvent.cpp (260932 => 260933)


--- trunk/Source/WebKit/Shared/WebMouseEvent.cpp	2020-04-30 03:03:17 UTC (rev 260932)
+++ trunk/Source/WebKit/Shared/WebMouseEvent.cpp	2020-04-30 04:16:00 UTC (rev 260933)
@@ -31,19 +31,7 @@
 namespace WebKit {
 using namespace WebCore;
 
-WebMouseEvent::WebMouseEvent()
-    : WebEvent()
-    , m_button(static_cast<uint32_t>(NoButton))
-    , m_deltaX(0)
-    , m_deltaY(0)
-    , m_deltaZ(0)
-    , m_clickCount(0)
-#if PLATFORM(MAC)
-    , m_eventNumber(-1)
-    , m_menuTypeForEvent(0)
-#endif
-{
-}
+WebMouseEvent::WebMouseEvent() = default;
 
 #if PLATFORM(MAC)
 WebMouseEvent::WebMouseEvent(Type type, Button button, unsigned short buttons, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, OptionSet<Modifier> modifiers, WallTime timestamp, double force, SyntheticClickType syntheticClickType, int eventNumber, int menuType)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to