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

Side by Side Diff: Source/core/events/EventTarget.h

Issue 815503002: Add counters for addEventListener/removeEventListener optional arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years 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 | « no previous file | Source/core/events/EventTarget.cpp » ('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, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 virtual const AtomicString& interfaceName() const = 0; 102 virtual const AtomicString& interfaceName() const = 0;
103 virtual ExecutionContext* executionContext() const = 0; 103 virtual ExecutionContext* executionContext() const = 0;
104 104
105 virtual Node* toNode(); 105 virtual Node* toNode();
106 virtual LocalDOMWindow* toDOMWindow(); 106 virtual LocalDOMWindow* toDOMWindow();
107 virtual MessagePort* toMessagePort(); 107 virtual MessagePort* toMessagePort();
108 108
109 // FIXME: first 2 args to addEventListener and removeEventListener should 109 // FIXME: first 2 args to addEventListener and removeEventListener should
110 // be required (per spec), but throwing TypeError breaks legacy content. 110 // be required (per spec), but throwing TypeError breaks legacy content.
111 // http://crbug.com/353484 111 // http://crbug.com/353484
112 bool addEventListener() { return false; } 112 bool addEventListener();
113 bool addEventListener(const AtomicString& eventType) { return false; } 113 bool addEventListener(const AtomicString& eventType);
114 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false); 114 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false);
115 bool removeEventListener() { return false; } 115 bool removeEventListener();
116 bool removeEventListener(const AtomicString& eventType) { return false; } 116 bool removeEventListener(const AtomicString& eventType);
117 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E ventListener>, bool useCapture = false); 117 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E ventListener>, bool useCapture = false);
118 virtual void removeAllEventListeners(); 118 virtual void removeAllEventListeners();
119 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>); 119 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>);
120 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>, ExceptionState&); // DOM A PI 120 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>, ExceptionState&); // DOM A PI
121 virtual void uncaughtExceptionInEventHandler(); 121 virtual void uncaughtExceptionInEventHandler();
122 122
123 // Used for legacy "onEvent" attribute APIs. 123 // Used for legacy "onEvent" attribute APIs.
124 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener>); 124 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener>);
125 EventListener* getAttributeEventListener(const AtomicString& eventType); 125 EventListener* getAttributeEventListener(const AtomicString& eventType);
126 126
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro 259 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro
260 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_ TARGET_REFCOUNTING(baseClass) 260 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_ TARGET_REFCOUNTING(baseClass)
261 #endif 261 #endif
262 262
263 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou nted. 263 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou nted.
264 // A ref-counted class that uses a different method of refcounting should use DE FINE_EVENT_TARGET_REFCOUNTING directly. 264 // A ref-counted class that uses a different method of refcounting should use DE FINE_EVENT_TARGET_REFCOUNTING directly.
265 // Both of these macros are meant to be placed just before the "public:" section of the class declaration. 265 // Both of these macros are meant to be placed just before the "public:" section of the class declaration.
266 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_ BE_REMOVED(RefCounted<className>) 266 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_ BE_REMOVED(RefCounted<className>)
267 267
268 #endif // EventTarget_h 268 #endif // EventTarget_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698