OLD | NEW |
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, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserv
ed. |
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 17 matching lines...) Expand all Loading... |
28 #include "wtf/RefPtr.h" | 28 #include "wtf/RefPtr.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 class RegisteredEventListener { | 32 class RegisteredEventListener { |
33 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 33 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
34 public: | 34 public: |
35 RegisteredEventListener(PassRefPtrWillBeRawPtr<EventListener> listener, cons
t EventListenerOptions& options) | 35 RegisteredEventListener(PassRefPtrWillBeRawPtr<EventListener> listener, cons
t EventListenerOptions& options) |
36 : listener(listener) | 36 : listener(listener) |
37 , useCapture(options.capture()) | 37 , useCapture(options.capture()) |
| 38 , passive(options.passive()) |
38 { | 39 { |
39 } | 40 } |
40 | 41 |
41 DEFINE_INLINE_TRACE() | 42 DEFINE_INLINE_TRACE() |
42 { | 43 { |
43 visitor->trace(listener); | 44 visitor->trace(listener); |
44 } | 45 } |
45 | 46 |
46 EventListenerOptions options() const | 47 EventListenerOptions options() const |
47 { | 48 { |
48 EventListenerOptions result; | 49 EventListenerOptions result; |
49 result.setCapture(useCapture); | 50 result.setCapture(useCapture); |
| 51 result.setPassive(passive); |
50 return result; | 52 return result; |
51 } | 53 } |
52 | 54 |
53 RefPtrWillBeMember<EventListener> listener; | 55 RefPtrWillBeMember<EventListener> listener; |
54 unsigned useCapture : 1; | 56 unsigned useCapture : 1; |
| 57 unsigned passive : 1; |
55 }; | 58 }; |
56 | 59 |
57 inline bool operator==(const RegisteredEventListener& a, const RegisteredEventLi
stener& b) | 60 inline bool operator==(const RegisteredEventListener& a, const RegisteredEventLi
stener& b) |
58 { | 61 { |
59 | 62 |
60 ASSERT(a.listener); | 63 ASSERT(a.listener); |
61 ASSERT(b.listener); | 64 ASSERT(b.listener); |
62 return *a.listener == *b.listener && a.useCapture == b.useCapture; | 65 return *a.listener == *b.listener && a.useCapture == b.useCapture && a.passi
ve == b.passive; |
63 } | 66 } |
64 | 67 |
65 } // namespace blink | 68 } // namespace blink |
66 | 69 |
67 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::RegisteredEventListener); | 70 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::RegisteredEventListener); |
68 | 71 |
69 #endif // RegisteredEventListener_h | 72 #endif // RegisteredEventListener_h |
OLD | NEW |