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

Side by Side Diff: third_party/WebKit/Source/core/events/Event.h

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 22 matching lines...) Expand all
33 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
34 #include "wtf/RefCounted.h" 34 #include "wtf/RefCounted.h"
35 #include "wtf/text/AtomicString.h" 35 #include "wtf/text/AtomicString.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class DOMWrapperWorld; 39 class DOMWrapperWorld;
40 class EventTarget; 40 class EventTarget;
41 class ExecutionContext; 41 class ExecutionContext;
42 42
43 class CORE_EXPORT Event : public RefCountedWillBeGarbageCollectedFinalized<Event >, public ScriptWrappable { 43 class CORE_EXPORT Event : public GarbageCollectedFinalized<Event>, public Scrip tWrappable {
44 DEFINE_WRAPPERTYPEINFO(); 44 DEFINE_WRAPPERTYPEINFO();
45 public: 45 public:
46 enum PhaseType { 46 enum PhaseType {
47 NONE = 0, 47 NONE = 0,
48 CAPTURING_PHASE = 1, 48 CAPTURING_PHASE = 1,
49 AT_TARGET = 2, 49 AT_TARGET = 2,
50 BUBBLING_PHASE = 3 50 BUBBLING_PHASE = 3
51 }; 51 };
52 52
53 enum EventType { 53 enum EventType {
(...skipping 14 matching lines...) Expand all
68 SELECT = 16384, 68 SELECT = 16384,
69 CHANGE = 32768 69 CHANGE = 32768
70 }; 70 };
71 71
72 enum RailsMode { 72 enum RailsMode {
73 RailsModeFree = 0, 73 RailsModeFree = 0,
74 RailsModeHorizontal = 1, 74 RailsModeHorizontal = 1,
75 RailsModeVertical = 2 75 RailsModeVertical = 2
76 }; 76 };
77 77
78 static PassRefPtrWillBeRawPtr<Event> create() 78 static RawPtr<Event> create()
79 { 79 {
80 return adoptRefWillBeNoop(new Event); 80 return (new Event);
81 } 81 }
82 82
83 // A factory for a simple event. The event doesn't bubble, and isn't 83 // A factory for a simple event. The event doesn't bubble, and isn't
84 // cancelable. 84 // cancelable.
85 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht ml#fire-a-simple-event 85 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht ml#fire-a-simple-event
86 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type) 86 static RawPtr<Event> create(const AtomicString& type)
87 { 87 {
88 return adoptRefWillBeNoop(new Event(type, false, false)); 88 return (new Event(type, false, false));
89 } 89 }
90 static PassRefPtrWillBeRawPtr<Event> createCancelable(const AtomicString& ty pe) 90 static RawPtr<Event> createCancelable(const AtomicString& type)
91 { 91 {
92 return adoptRefWillBeNoop(new Event(type, false, true)); 92 return (new Event(type, false, true));
93 } 93 }
94 static PassRefPtrWillBeRawPtr<Event> createBubble(const AtomicString& type) 94 static RawPtr<Event> createBubble(const AtomicString& type)
95 { 95 {
96 return adoptRefWillBeNoop(new Event(type, true, false)); 96 return (new Event(type, true, false));
97 } 97 }
98 static PassRefPtrWillBeRawPtr<Event> createCancelableBubble(const AtomicStri ng& type) 98 static RawPtr<Event> createCancelableBubble(const AtomicString& type)
99 { 99 {
100 return adoptRefWillBeNoop(new Event(type, true, true)); 100 return (new Event(type, true, true));
101 } 101 }
102 102
103 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const EventInit& initializer) 103 static RawPtr<Event> create(const AtomicString& type, const EventInit& initi alizer)
104 { 104 {
105 return adoptRefWillBeNoop(new Event(type, initializer)); 105 return (new Event(type, initializer));
106 } 106 }
107 107
108 virtual ~Event(); 108 virtual ~Event();
109 109
110 void initEvent(const AtomicString& type, bool canBubble, bool cancelable); 110 void initEvent(const AtomicString& type, bool canBubble, bool cancelable);
111 111
112 const AtomicString& type() const { return m_type; } 112 const AtomicString& type() const { return m_type; }
113 void setType(const AtomicString& type) { m_type = type; } 113 void setType(const AtomicString& type) { m_type = type; }
114 114
115 EventTarget* target() const { return m_target.get(); } 115 EventTarget* target() const { return m_target.get(); }
116 void setTarget(PassRefPtrWillBeRawPtr<EventTarget>); 116 void setTarget(RawPtr<EventTarget>);
117 117
118 EventTarget* currentTarget() const; 118 EventTarget* currentTarget() const;
119 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren tTarget; } 119 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren tTarget; }
120 120
121 unsigned short eventPhase() const { return m_eventPhase; } 121 unsigned short eventPhase() const { return m_eventPhase; }
122 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } 122 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; }
123 123
124 bool bubbles() const { return m_canBubble; } 124 bool bubbles() const { return m_canBubble; }
125 bool cancelable() const { return m_cancelable; } 125 bool cancelable() const { return m_cancelable; }
126 bool scoped() const { return m_scoped; } 126 bool scoped() const { return m_scoped; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual void preventDefault(); 173 virtual void preventDefault();
174 void setDefaultPrevented(bool defaultPrevented) { m_defaultPrevented = defau ltPrevented; } 174 void setDefaultPrevented(bool defaultPrevented) { m_defaultPrevented = defau ltPrevented; }
175 175
176 bool defaultHandled() const { return m_defaultHandled; } 176 bool defaultHandled() const { return m_defaultHandled; }
177 void setDefaultHandled() { m_defaultHandled = true; } 177 void setDefaultHandled() { m_defaultHandled = true; }
178 178
179 bool cancelBubble() const { return m_cancelBubble; } 179 bool cancelBubble() const { return m_cancelBubble; }
180 void setCancelBubble(bool cancel) { m_cancelBubble = cancel; } 180 void setCancelBubble(bool cancel) { m_cancelBubble = cancel; }
181 181
182 Event* underlyingEvent() const { return m_underlyingEvent.get(); } 182 Event* underlyingEvent() const { return m_underlyingEvent.get(); }
183 void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>); 183 void setUnderlyingEvent(RawPtr<Event>);
184 184
185 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } 185 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; }
186 void initEventPath(Node&); 186 void initEventPath(Node&);
187 187
188 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> path(ScriptState*) const; 188 HeapVector<Member<EventTarget>> path(ScriptState*) const;
189 189
190 bool isBeingDispatched() const { return eventPhase(); } 190 bool isBeingDispatched() const { return eventPhase(); }
191 191
192 // Events that must not leak across isolated world, similar to how 192 // Events that must not leak across isolated world, similar to how
193 // ErrorEvent behaves, can override this method. 193 // ErrorEvent behaves, can override this method.
194 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; } 194 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; }
195 195
196 virtual PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator(); 196 virtual RawPtr<EventDispatchMediator> createMediator();
197 197
198 bool isTrusted() const { return m_isTrusted; } 198 bool isTrusted() const { return m_isTrusted; }
199 void setTrusted(bool value) { m_isTrusted = value; } 199 void setTrusted(bool value) { m_isTrusted = value; }
200 200
201 void setHandlingPassive(bool value) { m_handlingPassive = value; } 201 void setHandlingPassive(bool value) { m_handlingPassive = value; }
202 202
203 DECLARE_VIRTUAL_TRACE(); 203 DECLARE_VIRTUAL_TRACE();
204 204
205 protected: 205 protected:
206 Event(); 206 Event();
(...skipping 16 matching lines...) Expand all
223 223
224 unsigned m_propagationStopped:1; 224 unsigned m_propagationStopped:1;
225 unsigned m_immediatePropagationStopped:1; 225 unsigned m_immediatePropagationStopped:1;
226 unsigned m_defaultPrevented:1; 226 unsigned m_defaultPrevented:1;
227 unsigned m_defaultHandled:1; 227 unsigned m_defaultHandled:1;
228 unsigned m_cancelBubble:1; 228 unsigned m_cancelBubble:1;
229 unsigned m_isTrusted : 1; 229 unsigned m_isTrusted : 1;
230 unsigned m_handlingPassive : 1; 230 unsigned m_handlingPassive : 1;
231 231
232 unsigned short m_eventPhase; 232 unsigned short m_eventPhase;
233 RefPtrWillBeMember<EventTarget> m_currentTarget; 233 Member<EventTarget> m_currentTarget;
234 RefPtrWillBeMember<EventTarget> m_target; 234 Member<EventTarget> m_target;
235 DOMTimeStamp m_createTime; 235 DOMTimeStamp m_createTime;
236 RefPtrWillBeMember<Event> m_underlyingEvent; 236 Member<Event> m_underlyingEvent;
237 OwnPtrWillBeMember<EventPath> m_eventPath; 237 Member<EventPath> m_eventPath;
238 // The monotonic platform time in seconds, for input events it is the 238 // The monotonic platform time in seconds, for input events it is the
239 // event timestamp provided by the host OS and reported in the original 239 // event timestamp provided by the host OS and reported in the original
240 // WebInputEvent instance. 240 // WebInputEvent instance.
241 double m_platformTimeStamp; 241 double m_platformTimeStamp;
242 }; 242 };
243 243
244 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ 244 #define DEFINE_EVENT_TYPE_CASTS(typeName) \
245 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) 245 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName())
246 246
247 } // namespace blink 247 } // namespace blink
248 248
249 #endif // Event_h 249 #endif // Event_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698