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

Side by Side Diff: Source/core/svg/SVGElementInstance.cpp

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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
« no previous file with comments | « Source/core/svg/SVGElementInstance.h ('k') | Source/core/workers/AbstractWorker.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 (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 return element->dispatchEvent(event); 242 return element->dispatchEvent(event);
243 } 243 }
244 244
245 EventTargetData* SVGElementInstance::eventTargetData() 245 EventTargetData* SVGElementInstance::eventTargetData()
246 { 246 {
247 // Since no event listeners are added to an SVGElementInstance, we don't hav e eventTargetData. 247 // Since no event listeners are added to an SVGElementInstance, we don't hav e eventTargetData.
248 return 0; 248 return 0;
249 } 249 }
250 250
251 EventTargetData* SVGElementInstance::ensureEventTargetData() 251 EventTargetData& SVGElementInstance::ensureEventTargetData()
252 { 252 {
253 // EventTarget would use these methods if we were actually using its add/rem oveEventListener logic. 253 // EventTarget would use these methods if we were actually using its add/rem oveEventListener logic.
254 // As we're forwarding those calls to the correspondingElement(), no one sho uld ever call this function. 254 // As we're forwarding those calls to the correspondingElement(), no one sho uld ever call this function.
255 ASSERT_NOT_REACHED(); 255 ASSERT_NOT_REACHED();
256 return 0; 256 return *eventTargetData();
257 } 257 }
258 258
259 SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* tar getElement) 259 SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* tar getElement)
260 : m_targetElement(targetElement) 260 : m_targetElement(targetElement)
261 { 261 {
262 if (m_targetElement) 262 if (m_targetElement)
263 m_targetElement->setInstanceUpdatesBlocked(true); 263 m_targetElement->setInstanceUpdatesBlocked(true);
264 } 264 }
265 265
266 SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker() 266 SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker()
267 { 267 {
268 if (m_targetElement) 268 if (m_targetElement)
269 m_targetElement->setInstanceUpdatesBlocked(false); 269 m_targetElement->setInstanceUpdatesBlocked(false);
270 } 270 }
271 271
272 } 272 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElementInstance.h ('k') | Source/core/workers/AbstractWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698