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

Unified Diff: Source/core/dom/ProcessingInstruction.h

Issue 738443003: Have ProcessingInstruction's XSLT event listener keep a weak backreference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/dom/ProcessingInstruction.cpp » ('j') | Source/core/dom/ProcessingInstruction.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ProcessingInstruction.h
diff --git a/Source/core/dom/ProcessingInstruction.h b/Source/core/dom/ProcessingInstruction.h
index 43f72e16bafd14b0c1bdd08741ccef9da43ae620..85936a0f730b4f7b25de735e42879c93aa7d2b7f 100644
--- a/Source/core/dom/ProcessingInstruction.h
+++ b/Source/core/dom/ProcessingInstruction.h
@@ -55,9 +55,26 @@ public:
bool isLoading() const;
// For XSLT
- void setEventListenerForXSLT(PassRefPtr<EventListener> listener) { m_listenerForXSLT = listener; }
- EventListener* eventListenerForXSLT() { return m_listenerForXSLT.get(); }
- void clearEventListenerForXSLT() { m_listenerForXSLT.clear(); }
+ class PIEventListener {
haraken 2014/11/24 01:17:00 PIEventListener => ProcessingInstructionEventListe
sof 2014/11/24 06:15:39 Renamed.
+ public:
+ virtual ~PIEventListener() { }
+
+ void ref() { refPIEventListener(); }
+ void deref() { derefPIEventListener(); }
+
+ virtual EventListener* toEventListener() = 0;
+
+ // Detach event listener from its processing instruction.
+ virtual void detach() = 0;
+
+ private:
+ virtual void refPIEventListener() = 0;
+ virtual void derefPIEventListener() = 0;
+ };
+
+ void setEventListenerForXSLT(PassRefPtr<PIEventListener> listener) { m_listenerForXSLT = listener; }
+ EventListener* eventListenerForXSLT();
+ void clearEventListenerForXSLT();
private:
ProcessingInstruction(Document&, const String& target, const String& data);
@@ -91,7 +108,7 @@ private:
bool m_isCSS;
bool m_isXSL;
- RefPtr<EventListener> m_listenerForXSLT;
+ RefPtr<PIEventListener> m_listenerForXSLT;
};
DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INSTRUCTION_NODE);
« no previous file with comments | « no previous file | Source/core/dom/ProcessingInstruction.cpp » ('j') | Source/core/dom/ProcessingInstruction.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698