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

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

Issue 1238083002: Oilpan: Move the EventListener hierarchy to Oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
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 27 matching lines...) Expand all
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class Event; 41 class Event;
42 class Node; 42 class Node;
43 43
44 // V8LazyEventListener is a wrapper for a JavaScript code string that is compile d and evaluated when an event is fired. 44 // V8LazyEventListener is a wrapper for a JavaScript code string that is compile d and evaluated when an event is fired.
45 // A V8LazyEventListener is either a HTML or SVG event handler. 45 // A V8LazyEventListener is either a HTML or SVG event handler.
46 class V8LazyEventListener final : public V8AbstractEventListener { 46 class V8LazyEventListener final : public V8AbstractEventListener {
47 public: 47 public:
48 static PassRefPtr<V8LazyEventListener> create(const AtomicString& functionNa me, const AtomicString& eventParameterName, const String& code, const String& so urceURL, const TextPosition& position, Node* node, v8::Isolate* isolate) 48 static PassRefPtrWillBeRawPtr<V8LazyEventListener> create(const AtomicString & functionName, const AtomicString& eventParameterName, const String& code, cons t String& sourceURL, const TextPosition& position, Node* node, v8::Isolate* isol ate)
49 { 49 {
50 return adoptRef(new V8LazyEventListener(isolate, functionName, eventPara meterName, code, sourceURL, position, node)); 50 return adoptRefWillBeNoop(new V8LazyEventListener(isolate, functionName, eventParameterName, code, sourceURL, position, node));
51 }
52
53 DEFINE_INLINE_VIRTUAL_TRACE()
54 {
55 visitor->trace(m_node);
56 V8AbstractEventListener::trace(visitor);
51 } 57 }
52 58
53 protected: 59 protected:
54 void prepareListenerObject(ExecutionContext*) override; 60 void prepareListenerObject(ExecutionContext*) override;
55 61
56 private: 62 private:
57 V8LazyEventListener(v8::Isolate*, const AtomicString& functionName, const At omicString& eventParameterName, const String& code, const String sourceURL, cons t TextPosition&, Node*); 63 V8LazyEventListener(v8::Isolate*, const AtomicString& functionName, const At omicString& eventParameterName, const String& code, const String sourceURL, cons t TextPosition&, Node*);
58 64
59 v8::Local<v8::Value> callListenerFunction(ScriptState*, v8::Local<v8::Value> , Event*) override; 65 v8::Local<v8::Value> callListenerFunction(ScriptState*, v8::Local<v8::Value> , Event*) override;
60 66
61 // Needs to return true for all event handlers implemented in JavaScript so that 67 // Needs to return true for all event handlers implemented in JavaScript so that
62 // the SVG code does not add the event handler in both 68 // the SVG code does not add the event handler in both
63 // SVGUseElement::buildShadowTree and again in 69 // SVGUseElement::buildShadowTree and again in
64 // SVGUseElement::transferEventListenersToShadowTree 70 // SVGUseElement::transferEventListenersToShadowTree
65 bool wasCreatedFromMarkup() const override { return true; } 71 bool wasCreatedFromMarkup() const override { return true; }
66 72
67 AtomicString m_functionName; 73 AtomicString m_functionName;
68 AtomicString m_eventParameterName; 74 AtomicString m_eventParameterName;
69 String m_code; 75 String m_code;
70 String m_sourceURL; 76 String m_sourceURL;
71 Node* m_node; 77 RawPtrWillBeMember<Node> m_node;
72 TextPosition m_position; 78 TextPosition m_position;
73 }; 79 };
74 80
75 } // namespace blink 81 } // namespace blink
76 82
77 #endif // V8LazyEventListener_h 83 #endif // V8LazyEventListener_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698