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

Side by Side Diff: Source/core/events/KeyboardEvent.cpp

Issue 1227363006: Virtualize EventDispatchMediator creation and cleanup calling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main
Patch Set: 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
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, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved.
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return true; 212 return true;
213 } 213 }
214 214
215 int KeyboardEvent::which() const 215 int KeyboardEvent::which() const
216 { 216 {
217 // Netscape's "which" returns a virtual key code for keydown and keyup, and a character code for keypress. 217 // Netscape's "which" returns a virtual key code for keydown and keyup, and a character code for keypress.
218 // That's exactly what IE's "keyCode" returns. So they are the same for keyb oard events. 218 // That's exactly what IE's "keyCode" returns. So they are the same for keyb oard events.
219 return keyCode(); 219 return keyCode();
220 } 220 }
221 221
222 PassRefPtrWillBeRawPtr<EventDispatchMediator> KeyboardEvent::createMediator()
223 {
224 return KeyboardEventDispatchMediator::create(this);
225 }
226
222 DEFINE_TRACE(KeyboardEvent) 227 DEFINE_TRACE(KeyboardEvent)
223 { 228 {
224 UIEventWithKeyState::trace(visitor); 229 UIEventWithKeyState::trace(visitor);
225 } 230 }
226 231
227 PassRefPtrWillBeRawPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMedia tor::create(PassRefPtrWillBeRawPtr<KeyboardEvent> event) 232 PassRefPtrWillBeRawPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMedia tor::create(PassRefPtrWillBeRawPtr<KeyboardEvent> event)
228 { 233 {
229 return adoptRefWillBeNoop(new KeyboardEventDispatchMediator(event)); 234 return adoptRefWillBeNoop(new KeyboardEventDispatchMediator(event));
230 } 235 }
231 236
232 KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtrWillBeRaw Ptr<KeyboardEvent> event) 237 KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtrWillBeRaw Ptr<KeyboardEvent> event)
233 : EventDispatchMediator(event) 238 : EventDispatchMediator(event)
234 { 239 {
235 } 240 }
236 241
237 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst 242 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst
238 { 243 {
239 // Make sure not to return true if we already took default action while hand ling the event. 244 // Make sure not to return true if we already took default action while hand ling the event.
240 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled(); 245 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
241 } 246 }
242 247
243 } // namespace blink 248 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698