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

Side by Side Diff: bindings/v8/V8LazyEventListener.h

Issue 160590: A patch for http://crbug.com/17400... (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: Created 11 years, 4 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
« no previous file with comments | « bindings/v8/V8DOMWrapper.cpp ('k') | bindings/v8/V8Utilities.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) 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class V8LazyEventListener : public V8AbstractEventListener { 46 class V8LazyEventListener : public V8AbstractEventListener {
47 public: 47 public:
48 static PassRefPtr<V8LazyEventListener> create(Frame* frame, const String & code, const String& functionName, bool isSVGEvent) 48 static PassRefPtr<V8LazyEventListener> create(Frame* frame, const String & code, const String& functionName, bool isSVGEvent)
49 { 49 {
50 return adoptRef(new V8LazyEventListener(frame, code, functionName, i sSVGEvent)); 50 return adoptRef(new V8LazyEventListener(frame, code, functionName, i sSVGEvent));
51 } 51 }
52 52
53 // For lazy event listener, the listener object is the same as its liste ner 53 // For lazy event listener, the listener object is the same as its liste ner
54 // function without additional scope chains. 54 // function without additional scope chains.
55 virtual v8::Local<v8::Object> getListenerObject() { return getWrappedLis tenerFunction(); } 55 virtual v8::Local<v8::Object> getListenerObject() { return getWrappedLis tenerFunction(); }
56 56 virtual bool isLazy() { return true; }
57 private: 57 private:
58 V8LazyEventListener(Frame*, const String& code, const String& functionNa me, bool isSVGEvent); 58 V8LazyEventListener(Frame*, const String& code, const String& functionNa me, bool isSVGEvent);
59 virtual ~V8LazyEventListener(); 59 virtual ~V8LazyEventListener();
60 60
61 virtual bool virtualisAttribute() const { return true; } 61 virtual bool virtualisAttribute() const { return true; }
62 62
63 String m_code; 63 String m_code;
64 String m_functionName; 64 String m_functionName;
65 bool m_isSVGEvent; 65 bool m_isSVGEvent;
66 bool m_compiled; 66 bool m_compiled;
67 67
68 // If the event listener is on a non-document dom node, we compile the f unction with some implicit scope chains before it. 68 // If the event listener is on a non-document dom node, we compile the f unction with some implicit scope chains before it.
69 bool m_wrappedFunctionCompiled; 69 bool m_wrappedFunctionCompiled;
70 v8::Persistent<v8::Function> m_wrappedFunction; 70 v8::Persistent<v8::Function> m_wrappedFunction;
71 71
72 v8::Local<v8::Function> getWrappedListenerFunction(); 72 v8::Local<v8::Function> getWrappedListenerFunction();
73 73
74 virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*, bool isWindowEvent); 74 virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*, bool isWindowEvent);
75 75
76 v8::Local<v8::Function> getListenerFunction(); 76 v8::Local<v8::Function> getListenerFunction();
77 }; 77 };
78 78
79 } // namespace WebCore 79 } // namespace WebCore
80 80
81 #endif // V8LazyEventListener_h 81 #endif // V8LazyEventListener_h
OLDNEW
« no previous file with comments | « bindings/v8/V8DOMWrapper.cpp ('k') | bindings/v8/V8Utilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698