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

Side by Side Diff: Source/core/events/WheelEvent.h

Issue 1227363006: Virtualize EventDispatchMediator creation and cleanup calling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main
Patch Set: Rebase Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/events/TouchEvent.cpp ('k') | Source/core/events/WheelEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DOM_DELTA_PIXEL = 0, 44 DOM_DELTA_PIXEL = 0,
45 DOM_DELTA_LINE, 45 DOM_DELTA_LINE,
46 DOM_DELTA_PAGE 46 DOM_DELTA_PAGE
47 }; 47 };
48 48
49 static PassRefPtrWillBeRawPtr<WheelEvent> create() 49 static PassRefPtrWillBeRawPtr<WheelEvent> create()
50 { 50 {
51 return adoptRefWillBeNoop(new WheelEvent); 51 return adoptRefWillBeNoop(new WheelEvent);
52 } 52 }
53 53
54 static PassRefPtrWillBeRawPtr<WheelEvent> create(const PlatformWheelEvent& p latformEvent, PassRefPtrWillBeRawPtr<AbstractView>);
55
54 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c onst WheelEventInit& initializer) 56 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c onst WheelEventInit& initializer)
55 { 57 {
56 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); 58 return adoptRefWillBeNoop(new WheelEvent(type, initializer));
57 } 59 }
58 60
59 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick s, 61 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick s,
60 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A bstractView> view, 62 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A bstractView> view,
61 const IntPoint& screenLocation, const IntPoint& windowLocation, 63 const IntPoint& screenLocation, const IntPoint& windowLocation,
62 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode railsMode) 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode railsMode)
63 { 65 {
(...skipping 11 matching lines...) Expand all
75 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; } 77 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; }
76 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; } 78 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; }
77 bool canScroll() const { return m_canScroll; } 79 bool canScroll() const { return m_canScroll; }
78 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 80 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
79 RailsMode railsMode() const { return m_railsMode; } 81 RailsMode railsMode() const { return m_railsMode; }
80 82
81 const AtomicString& interfaceName() const override; 83 const AtomicString& interfaceName() const override;
82 bool isMouseEvent() const override; 84 bool isMouseEvent() const override;
83 bool isWheelEvent() const override; 85 bool isWheelEvent() const override;
84 86
87 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override;
88
85 DECLARE_VIRTUAL_TRACE(); 89 DECLARE_VIRTUAL_TRACE();
86 90
87 private: 91 private:
88 WheelEvent(); 92 WheelEvent();
89 WheelEvent(const AtomicString&, const WheelEventInit&); 93 WheelEvent(const AtomicString&, const WheelEventInit&);
90 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 94 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
91 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo cation, const IntPoint& windowLocation, 95 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo cation, const IntPoint& windowLocation,
92 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode); 96 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode);
93 97
94 IntPoint m_wheelDelta; 98 IntPoint m_wheelDelta;
95 double m_deltaX; 99 double m_deltaX;
96 double m_deltaY; 100 double m_deltaY;
97 double m_deltaZ; 101 double m_deltaZ;
98 unsigned m_deltaMode; 102 unsigned m_deltaMode;
99 bool m_canScroll; 103 bool m_canScroll;
100 bool m_hasPreciseScrollingDeltas; 104 bool m_hasPreciseScrollingDeltas;
101 RailsMode m_railsMode; 105 RailsMode m_railsMode;
102 }; 106 };
103 107
104 DEFINE_EVENT_TYPE_CASTS(WheelEvent); 108 DEFINE_EVENT_TYPE_CASTS(WheelEvent);
105 109
106 class WheelEventDispatchMediator final : public EventDispatchMediator { 110 class WheelEventDispatchMediator final : public EventDispatchMediator {
107 public: 111 public:
108 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); 112 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(PassRefPtrW illBeRawPtr<WheelEvent>);
113
109 private: 114 private:
110 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr <AbstractView>); 115 explicit WheelEventDispatchMediator(PassRefPtrWillBeRawPtr<WheelEvent>);
111 WheelEvent& event() const; 116 WheelEvent& event() const;
112 bool dispatchEvent(EventDispatcher&) const override; 117 bool dispatchEvent(EventDispatcher&) const override;
113 }; 118 };
114 119
115 } // namespace blink 120 } // namespace blink
116 121
117 #endif // WheelEvent_h 122 #endif // WheelEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/TouchEvent.cpp ('k') | Source/core/events/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698