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

Side by Side Diff: Source/core/events/TouchEvent.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: 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.h ('k') | Source/core/events/WheelEvent.h » ('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 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 UIEventWithKeyState::preventDefault(); 102 UIEventWithKeyState::preventDefault();
103 103
104 // A common developer error is to wait too long before attempting to stop 104 // A common developer error is to wait too long before attempting to stop
105 // scrolling by consuming a touchmove event. Generate a warning if this 105 // scrolling by consuming a touchmove event. Generate a warning if this
106 // event is uncancelable. 106 // event is uncancelable.
107 if (!cancelable() && view() && view()->isLocalDOMWindow() && view()->frame() ) { 107 if (!cancelable() && view() && view()->isLocalDOMWindow() && view()->frame() ) {
108 toLocalDOMWindow(view())->frame()->console().addMessage(ConsoleMessage:: create(JSMessageSource, WarningMessageLevel, 108 toLocalDOMWindow(view())->frame()->console().addMessage(ConsoleMessage:: create(JSMessageSource, WarningMessageLevel,
109 "Ignored attempt to cancel a " + type() + " event with cancelable=fa lse, for example because scrolling is in progress and cannot be interrupted.")); 109 "Ignored attempt to cancel a " + type() + " event with cancelable=fa lse, for example because scrolling is in progress and cannot be interrupted."));
110 } 110 }
111 } 111 }
112
113 PassRefPtrWillBeRawPtr<EventDispatchMediator> TouchEvent::createMediator()
114 {
115 return TouchEventDispatchMediator::create(this);
116 }
117
112 DEFINE_TRACE(TouchEvent) 118 DEFINE_TRACE(TouchEvent)
113 { 119 {
114 visitor->trace(m_touches); 120 visitor->trace(m_touches);
115 visitor->trace(m_targetTouches); 121 visitor->trace(m_targetTouches);
116 visitor->trace(m_changedTouches); 122 visitor->trace(m_changedTouches);
117 UIEventWithKeyState::trace(visitor); 123 UIEventWithKeyState::trace(visitor);
118 } 124 }
119 125
120 PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::c reate(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent) 126 PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::c reate(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent)
121 { 127 {
(...skipping 10 matching lines...) Expand all
132 return toTouchEvent(EventDispatchMediator::event()); 138 return toTouchEvent(EventDispatchMediator::event());
133 } 139 }
134 140
135 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t 141 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t
136 { 142 {
137 event().eventPath().adjustForTouchEvent(event()); 143 event().eventPath().adjustForTouchEvent(event());
138 return dispatcher.dispatch(); 144 return dispatcher.dispatch();
139 } 145 }
140 146
141 } // namespace blink 147 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/TouchEvent.h ('k') | Source/core/events/WheelEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698