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

Side by Side Diff: Source/core/events/EventTarget.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/events/EventTarget.h ('k') | Source/core/fileapi/FileReader.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) 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 inline DOMWindow* EventTarget::executingWindow() 77 inline DOMWindow* EventTarget::executingWindow()
78 { 78 {
79 if (ScriptExecutionContext* context = scriptExecutionContext()) 79 if (ScriptExecutionContext* context = scriptExecutionContext())
80 return context->executingWindow(); 80 return context->executingWindow();
81 return 0; 81 return 0;
82 } 82 }
83 83
84 bool EventTarget::addEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener> listener, bool useCapture) 84 bool EventTarget::addEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener> listener, bool useCapture)
85 { 85 {
86 EventTargetData* d = ensureEventTargetData(); 86 return ensureEventTargetData().eventListenerMap.add(eventType, listener, use Capture);
87 return d->eventListenerMap.add(eventType, listener, useCapture);
88 } 87 }
89 88
90 bool EventTarget::removeEventListener(const AtomicString& eventType, EventListen er* listener, bool useCapture) 89 bool EventTarget::removeEventListener(const AtomicString& eventType, EventListen er* listener, bool useCapture)
91 { 90 {
92 EventTargetData* d = eventTargetData(); 91 EventTargetData* d = eventTargetData();
93 if (!d) 92 if (!d)
94 return false; 93 return false;
95 94
96 size_t indexOfRemovedListener; 95 size_t indexOfRemovedListener;
97 96
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // they have one less listener to invoke. 356 // they have one less listener to invoke.
358 if (d->firingEventIterators) { 357 if (d->firingEventIterators) {
359 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 358 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
360 d->firingEventIterators->at(i).iterator = 0; 359 d->firingEventIterators->at(i).iterator = 0;
361 d->firingEventIterators->at(i).end = 0; 360 d->firingEventIterators->at(i).end = 0;
362 } 361 }
363 } 362 }
364 } 363 }
365 364
366 } // namespace WebCore 365 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/events/EventTarget.h ('k') | Source/core/fileapi/FileReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698