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

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

Issue 10007027: Merge 113086 - [v8] Fix memory leak in V8LazyEventListener (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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
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 30 matching lines...) Expand all
41 41
42 class Event; 42 class Event;
43 class Frame; 43 class Frame;
44 class HTMLFormElement; 44 class HTMLFormElement;
45 class Node; 45 class Node;
46 46
47 // V8LazyEventListener is a wrapper for a JavaScript code string that is com piled and evaluated when an event is fired. 47 // V8LazyEventListener is a wrapper for a JavaScript code string that is com piled and evaluated when an event is fired.
48 // A V8LazyEventListener is either a HTML or SVG event handler. 48 // A V8LazyEventListener is either a HTML or SVG event handler.
49 class V8LazyEventListener : public V8AbstractEventListener { 49 class V8LazyEventListener : public V8AbstractEventListener {
50 public: 50 public:
51 static PassRefPtr<V8LazyEventListener> create(const AtomicString& functi onName, const AtomicString& eventParameterName, const String& code, const String & sourceURL, const TextPosition& position, PassRefPtr<Node> node, const WorldCon textHandle& worldContext) 51 static PassRefPtr<V8LazyEventListener> create(const AtomicString& functi onName, const AtomicString& eventParameterName, const String& code, const String & sourceURL, const TextPosition& position, Node* node, const WorldContextHandle& worldContext)
52 { 52 {
53 return adoptRef(new V8LazyEventListener(functionName, eventParameter Name, code, sourceURL, position, node, worldContext)); 53 return adoptRef(new V8LazyEventListener(functionName, eventParameter Name, code, sourceURL, position, node, worldContext));
54 } 54 }
55 55
56 virtual bool isLazy() const { return true; } 56 virtual bool isLazy() const { return true; }
57 57
58 protected: 58 protected:
59 virtual void prepareListenerObject(ScriptExecutionContext*); 59 virtual void prepareListenerObject(ScriptExecutionContext*);
60 60
61 private: 61 private:
62 V8LazyEventListener(const AtomicString& functionName, const AtomicString & eventParameterName, const String& code, const String sourceURL, const TextPosi tion&, PassRefPtr<Node>, const WorldContextHandle&); 62 V8LazyEventListener(const AtomicString& functionName, const AtomicString & eventParameterName, const String& code, const String sourceURL, const TextPosi tion&, Node*, const WorldContextHandle&);
63 63
64 virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext *, v8::Handle<v8::Value> jsEvent, Event*); 64 virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext *, v8::Handle<v8::Value> jsEvent, Event*);
65 65
66 // Needs to return true for all event handlers implemented in JavaScript so that 66 // Needs to return true for all event handlers implemented in JavaScript so that
67 // the SVG code does not add the event handler in both 67 // the SVG code does not add the event handler in both
68 // SVGUseElement::buildShadowTree and again in 68 // SVGUseElement::buildShadowTree and again in
69 // SVGUseElement::transferEventListenersToShadowTree 69 // SVGUseElement::transferEventListenersToShadowTree
70 virtual bool wasCreatedFromMarkup() const { return true; } 70 virtual bool wasCreatedFromMarkup() const { return true; }
71 71
72 AtomicString m_functionName; 72 AtomicString m_functionName;
73 AtomicString m_eventParameterName; 73 AtomicString m_eventParameterName;
74 String m_code; 74 String m_code;
75 String m_sourceURL; 75 String m_sourceURL;
76 RefPtr<Node> m_node; 76 Node* m_node;
77 RefPtr<HTMLFormElement> m_formElement;
78 TextPosition m_position; 77 TextPosition m_position;
79 }; 78 };
80 79
81 } // namespace WebCore 80 } // namespace WebCore
82 81
83 #endif // V8LazyEventListener_h 82 #endif // V8LazyEventListener_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/inline-event-attributes-release-expected.txt ('k') | Source/WebCore/bindings/v8/V8LazyEventListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698