OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
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 | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 : 0; | 62 : 0; |
63 } | 63 } |
64 | 64 |
65 static V8AbstractEventListener* cast(EventListener* listener) | 65 static V8AbstractEventListener* cast(EventListener* listener) |
66 { | 66 { |
67 return const_cast<V8AbstractEventListener*>(cast(const_cast<const Ev
entListener*>(listener))); | 67 return const_cast<V8AbstractEventListener*>(cast(const_cast<const Ev
entListener*>(listener))); |
68 } | 68 } |
69 | 69 |
70 // Implementation of EventListener interface. | 70 // Implementation of EventListener interface. |
71 | 71 |
72 virtual bool operator==(const EventListener& other) { return this == &ot
her; } | 72 virtual bool operator==(const EventListener& other) OVERRIDE { return th
is == &other; } |
73 | 73 |
74 virtual void handleEvent(ExecutionContext*, Event*); | 74 virtual void handleEvent(ExecutionContext*, Event*) OVERRIDE; |
75 | 75 |
76 virtual bool isLazy() const { return false; } | 76 virtual bool isLazy() const { return false; } |
77 | 77 |
78 // Returns the listener object, either a function or an object. | 78 // Returns the listener object, either a function or an object. |
79 v8::Local<v8::Object> getListenerObject(ExecutionContext* context) | 79 v8::Local<v8::Object> getListenerObject(ExecutionContext* context) |
80 { | 80 { |
81 // prepareListenerObject can potentially deref this event listener | 81 // prepareListenerObject can potentially deref this event listener |
82 // as it may attempt to compile a function (lazy event listener), ge
t an error | 82 // as it may attempt to compile a function (lazy event listener), ge
t an error |
83 // and invoke onerror callback which can execute arbitrary JS code. | 83 // and invoke onerror callback which can execute arbitrary JS code. |
84 // Protect this event listener to keep it alive. | 84 // Protect this event listener to keep it alive. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Indicates if this is an HTML type listener. | 139 // Indicates if this is an HTML type listener. |
140 bool m_isAttribute; | 140 bool m_isAttribute; |
141 | 141 |
142 RefPtr<DOMWrapperWorld> m_world; | 142 RefPtr<DOMWrapperWorld> m_world; |
143 v8::Isolate* m_isolate; | 143 v8::Isolate* m_isolate; |
144 }; | 144 }; |
145 | 145 |
146 } // namespace WebCore | 146 } // namespace WebCore |
147 | 147 |
148 #endif // V8AbstractEventListener_h | 148 #endif // V8AbstractEventListener_h |
OLD | NEW |