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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 { 2154 {
2155 if (!hasEventTargetData()) 2155 if (!hasEventTargetData())
2156 return; 2156 return;
2157 2157
2158 if (isDisabledFormControl(this) && event->isMouseEvent()) 2158 if (isDisabledFormControl(this) && event->isMouseEvent())
2159 return; 2159 return;
2160 2160
2161 fireEventListeners(event); 2161 fireEventListeners(event);
2162 } 2162 }
2163 2163
2164 void Node::dispatchScopedEvent(PassRefPtr<Event> event) 2164 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event)
2165 { 2165 {
2166 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); 2166 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event));
2167 } 2167 }
2168 2168
2169 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator> eventDispatchMediator) 2169 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator> eventDispatchMediator)
2170 { 2170 {
2171 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); 2171 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator);
2172 } 2172 }
2173 2173
2174 bool Node::dispatchEvent(PassRefPtr<Event> event) 2174 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
2175 { 2175 {
2176 if (event->isMouseEvent()) 2176 if (event->isMouseEvent())
2177 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator:: create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synth eticMouseEvent)); 2177 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator:: create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synth eticMouseEvent));
2178 if (event->isTouchEvent()) 2178 if (event->isTouchEvent())
2179 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); 2179 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event));
2180 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev ent)); 2180 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev ent));
2181 } 2181 }
2182 2182
2183 void Node::dispatchSubtreeModifiedEvent() 2183 void Node::dispatchSubtreeModifiedEvent()
2184 { 2184 {
2185 if (isInShadowTree()) 2185 if (isInShadowTree())
2186 return; 2186 return;
2187 2187
2188 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 2188 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
2189 2189
2190 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) 2190 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER))
2191 return; 2191 return;
2192 2192
2193 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified , true)); 2193 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified , true));
2194 } 2194 }
2195 2195
2196 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven t) 2196 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un derlyingEvent)
2197 { 2197 {
2198 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 2198 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
2199 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t rue, document().domWindow(), detail); 2199 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv ate, true, true, document().domWindow(), detail);
2200 event->setUnderlyingEvent(underlyingEvent); 2200 event->setUnderlyingEvent(underlyingEvent);
2201 dispatchScopedEvent(event); 2201 dispatchScopedEvent(event);
2202 return event->defaultHandled(); 2202 return event->defaultHandled();
2203 } 2203 }
2204 2204
2205 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) 2205 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event)
2206 { 2206 {
2207 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().domWindow()))); 2207 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().domWindow())));
2208 } 2208 }
2209 2209
2210 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin g& eventType, 2210 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin g& eventType,
2211 int detail, Node* relatedTarget) 2211 int detail, Node* relatedTarget)
2212 { 2212 {
2213 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea te(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedT arget))); 2213 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea te(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedT arget)));
2214 } 2214 }
2215 2215
2216 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) 2216 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
2217 { 2217 {
2218 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindo w(), event); 2218 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen t().domWindow(), event);
2219 if (!gestureEvent.get()) 2219 if (!gestureEvent.get())
2220 return false; 2220 return false;
2221 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent)); 2221 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent));
2222 } 2222 }
2223 2223
2224 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) 2224 bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event)
2225 { 2225 {
2226 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea te(event)); 2226 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea te(event));
2227 } 2227 }
2228 2228
2229 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions) 2229 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions)
2230 { 2230 {
2231 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions) ; 2231 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions) ;
2232 } 2232 }
2233 2233
2234 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) 2234 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 node->showTreeForThis(); 2524 node->showTreeForThis();
2525 } 2525 }
2526 2526
2527 void showNodePath(const WebCore::Node* node) 2527 void showNodePath(const WebCore::Node* node)
2528 { 2528 {
2529 if (node) 2529 if (node)
2530 node->showNodePathForThis(); 2530 node->showNodePathForThis();
2531 } 2531 }
2532 2532
2533 #endif 2533 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698