Changeset 191080 in webkit


Ignore:
Timestamp:
Oct 14, 2015 6:21:19 PM (9 years ago)
Author:
timothy_horton@apple.com
Message:

Move some EventHandler initialization to the header
https://bugs.webkit.org/show_bug.cgi?id=150139

Reviewed by Andreas Kling.

No new tests, just cleanup.

  • page/EventHandler.cpp:

(WebCore::EventHandler::EventHandler): Deleted.

  • page/EventHandler.h:

Also found one member which was unused, and a few that were uninitialized.
It's likely the uninitialized ones didn't actually cause any trouble because
they are reset in lots of places, but this seems better.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r191077 r191080  
     12015-10-14  Tim Horton  <timothy_horton@apple.com>
     2
     3        Move some EventHandler initialization to the header
     4        https://bugs.webkit.org/show_bug.cgi?id=150139
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new tests, just cleanup.
     9
     10        * page/EventHandler.cpp:
     11        (WebCore::EventHandler::EventHandler): Deleted.
     12        * page/EventHandler.h:
     13        Also found one member which was unused, and a few that were uninitialized.
     14        It's likely the uninitialized ones didn't actually cause any trouble because
     15        they are reset in lots of places, but this seems better.
     16
    1172015-10-14  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebCore/page/EventHandler.cpp

    r189239 r191080  
    374374EventHandler::EventHandler(Frame& frame)
    375375    : m_frame(frame)
    376     , m_mousePressed(false)
    377     , m_capturesDragging(false)
    378     , m_mouseDownMayStartSelect(false)
    379 #if ENABLE(DRAG_SUPPORT)
    380     , m_mouseDownMayStartDrag(false)
    381     , m_dragMayStartSelectionInstead(false)
    382 #endif
    383     , m_mouseDownWasSingleClickInSelection(false)
    384     , m_selectionInitiationState(HaveNotStartedSelection)
    385376    , m_hoverTimer(*this, &EventHandler::hoverTimerFired)
    386377#if ENABLE(CURSOR_SUPPORT)
     
    388379#endif
    389380    , m_longMousePressTimer(*this, &EventHandler::recognizeLongMousePress)
    390     , m_didRecognizeLongMousePress(false)
    391381    , m_autoscrollController(std::make_unique<AutoscrollController>())
    392     , m_mouseDownMayStartAutoscroll(false)
    393     , m_mouseDownWasInSubframe(false)
    394382#if !ENABLE(IOS_TOUCH_EVENTS)
    395383    , m_fakeMouseMoveEventTimer(*this, &EventHandler::fakeMouseMoveEventTimerFired)
    396384#endif
    397     , m_svgPan(false)
    398     , m_resizeLayer(nullptr)
    399     , m_eventHandlerWillResetCapturingMouseEventsElement(false)
    400     , m_clickCount(0)
    401 #if ENABLE(IOS_GESTURE_EVENTS)
    402     , m_gestureInitialDiameter(GestureUnknown)
    403     , m_gestureLastDiameter(GestureUnknown)
    404     , m_gestureInitialRotation(GestureUnknown)
    405     , m_gestureLastRotation(GestureUnknown)
    406 #endif
    407 #if ENABLE(IOS_TOUCH_EVENTS)
    408     , m_firstTouchID(InvalidTouchIdentifier)
    409 #endif
    410     , m_mousePositionIsUnknown(true)
    411     , m_mouseDownTimestamp(0)
    412 #if PLATFORM(COCOA)
    413     , m_mouseDownView(nil)
    414     , m_sendingEventToSubview(false)
    415 #if !PLATFORM(IOS)
    416     , m_activationEventNumber(-1)
    417 #endif // !PLATFORM(IOS)
    418 #endif
    419 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    420     , m_originatingTouchPointTargetKey(0)
    421     , m_touchPressed(false)
    422 #endif
    423     , m_maxMouseMovedDuration(0)
    424     , m_baseEventType(PlatformEvent::NoType)
    425     , m_didStartDrag(false)
    426     , m_didLongPressInvokeContextMenu(false)
    427     , m_isHandlingWheelEvent(false)
    428385#if ENABLE(CURSOR_VISIBILITY)
    429386    , m_autoHideCursorTimer(*this, &EventHandler::autoHideCursorTimerFired)
    430387#endif
    431     , m_immediateActionStage(ImmediateActionStage::None)
    432388{
    433389}
  • trunk/Source/WebCore/page/EventHandler.h

    r189168 r191080  
    4545
    4646#if PLATFORM(IOS)
     47OBJC_CLASS WebEvent;
     48OBJC_CLASS WAKView;
    4749#ifdef __OBJC__
    48 @class WebEvent;
    49 @class WAKView;
    5050#include "WAKAppKitStubs.h"
    51 #else
    52 class WebEvent;
    5351#endif
    5452#endif // PLATFORM(IOS)
    5553
    56 #if PLATFORM(COCOA) && !defined(__OBJC__)
    57 class NSView;
     54#if PLATFORM(COCOA)
     55OBJC_CLASS NSView;
    5856#endif
    5957
     
    262260    void focusDocumentView();
    263261   
    264     WEBCORE_EXPORT void sendScrollEvent(); // Ditto
     262    WEBCORE_EXPORT void sendScrollEvent();
    265263
    266264#if PLATFORM(COCOA) && defined(__OBJC__)
     
    471469    Frame& m_frame;
    472470
    473     bool m_mousePressed;
    474     bool m_capturesDragging;
     471    bool m_mousePressed { false };
     472    bool m_capturesDragging { false };
    475473    RefPtr<Node> m_mousePressNode;
    476474
    477     bool m_mouseDownMayStartSelect;
    478 #if ENABLE(DRAG_SUPPORT)
    479     bool m_mouseDownMayStartDrag;
    480     bool m_dragMayStartSelectionInstead;
    481 #endif
    482     bool m_mouseDownWasSingleClickInSelection;
     475    bool m_mouseDownMayStartSelect { false };
     476#if ENABLE(DRAG_SUPPORT)
     477    bool m_mouseDownMayStartDrag { false };
     478    bool m_dragMayStartSelectionInstead { false };
     479#endif
     480    bool m_mouseDownWasSingleClickInSelection { false };
    483481    enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection };
    484     SelectionInitiationState m_selectionInitiationState;
     482    SelectionInitiationState m_selectionInitiationState { HaveNotStartedSelection };
    485483
    486484#if ENABLE(DRAG_SUPPORT)
     
    488486#endif
    489487
    490     bool m_panScrollButtonPressed;
     488    bool m_panScrollButtonPressed { false };
    491489
    492490    Timer m_hoverTimer;
     
    496494
    497495    Timer m_longMousePressTimer;
    498     bool m_didRecognizeLongMousePress;
     496    bool m_didRecognizeLongMousePress { false };
    499497
    500498    std::unique_ptr<AutoscrollController> m_autoscrollController;
    501     bool m_mouseDownMayStartAutoscroll;
    502     bool m_mouseDownWasInSubframe;
     499    bool m_mouseDownMayStartAutoscroll { false };
     500    bool m_mouseDownWasInSubframe { false };
    503501
    504502#if !ENABLE(IOS_TOUCH_EVENTS)
     
    506504#endif
    507505
    508     bool m_svgPan;
    509 
    510     RenderLayer* m_resizeLayer;
     506    bool m_svgPan { false };
     507
     508    RenderLayer* m_resizeLayer { nullptr };
    511509
    512510    RefPtr<Element> m_capturingMouseEventsElement;
    513     bool m_eventHandlerWillResetCapturingMouseEventsElement;
     511    bool m_eventHandlerWillResetCapturingMouseEventsElement { false };
    514512   
    515513    RefPtr<Element> m_elementUnderMouse;
     
    519517    Cursor m_currentMouseCursor;
    520518
    521     int m_clickCount;
     519    int m_clickCount { 0 };
    522520    RefPtr<Node> m_clickNode;
    523521
    524522#if ENABLE(IOS_GESTURE_EVENTS)
    525     float m_gestureInitialDiameter;
    526     float m_gestureLastDiameter;
    527     float m_gestureInitialRotation;
    528     float m_gestureLastRotation;
     523    float m_gestureInitialDiameter { GestureUnknown };
     524    float m_gestureInitialRotation { GestureUnknown };
     525    float m_gestureLastDiameter { GestureUnknown };
     526    float m_gestureLastRotation { GestureUnknown };
     527    EventTargetSet m_gestureTargets;
    529528#endif
    530529
    531530#if ENABLE(IOS_TOUCH_EVENTS)
    532     unsigned m_firstTouchID;
     531    unsigned m_firstTouchID { InvalidTouchIdentifier };
    533532
    534533    TouchArray m_touches;
    535     EventTargetSet m_gestureTargets;
    536534    RefPtr<Frame> m_touchEventTargetSubframe;
    537535#endif
     
    539537#if ENABLE(DRAG_SUPPORT)
    540538    RefPtr<Element> m_dragTarget;
    541     bool m_shouldOnlyFireDragOverEvent;
     539    bool m_shouldOnlyFireDragOverEvent { false };
    542540#endif
    543541   
     
    546544    LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeLayer.
    547545   
    548     bool m_mousePositionIsUnknown;
     546    bool m_mousePositionIsUnknown { true };
    549547    IntPoint m_lastKnownMousePosition;
    550548    IntPoint m_lastKnownMouseGlobalPosition;
    551549    IntPoint m_mouseDownPos; // In our view's coords.
    552     double m_mouseDownTimestamp;
     550    double m_mouseDownTimestamp { 0 };
    553551    PlatformMouseEvent m_mouseDown;
    554552
    555553#if PLATFORM(COCOA)
    556     NSView *m_mouseDownView;
    557     bool m_sendingEventToSubview;
    558     bool m_startedGestureAtScrollLimit;
     554    NSView *m_mouseDownView { nullptr };
     555    bool m_sendingEventToSubview { false };
    559556#if !PLATFORM(IOS)
    560     int m_activationEventNumber;
     557    int m_activationEventNumber { -1 };
    561558#endif
    562559#endif
     
    565562    TouchTargetMap m_originatingTouchPointTargets;
    566563    RefPtr<Document> m_originatingTouchPointDocument;
    567     unsigned m_originatingTouchPointTargetKey;
    568     bool m_touchPressed;
    569 #endif
    570 
    571     double m_maxMouseMovedDuration;
    572     PlatformEvent::Type m_baseEventType;
    573     bool m_didStartDrag;
    574     bool m_didLongPressInvokeContextMenu;
    575     bool m_isHandlingWheelEvent;
     564    unsigned m_originatingTouchPointTargetKey { 0 };
     565    bool m_touchPressed { false };
     566#endif
     567
     568    double m_maxMouseMovedDuration { 0 };
     569    PlatformEvent::Type m_baseEventType { PlatformEvent::NoType };
     570    bool m_didStartDrag { false };
     571    bool m_didLongPressInvokeContextMenu { false };
     572    bool m_isHandlingWheelEvent { false };
    576573
    577574#if ENABLE(CURSOR_VISIBILITY)
     
    579576#endif
    580577
    581     ImmediateActionStage m_immediateActionStage;
     578    ImmediateActionStage m_immediateActionStage { ImmediateActionStage::None };
    582579};
    583580
Note: See TracChangeset for help on using the changeset viewer.