diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h b/chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h index 17f99842250..d53e5327603 100644 --- a/chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h +++ b/chromium/third_party/WebKit/Source/core/xml/XSLStyleSheet.h @@ -23,11 +23,10 @@ #ifndef XSLStyleSheet_h #define XSLStyleSheet_h -#include "RuntimeEnabledFeatures.h" #include "core/css/StyleSheet.h" #include "core/dom/ProcessingInstruction.h" +#include "platform/RuntimeEnabledFeatures.h" #include "wtf/PassRefPtr.h" - #include <libxml/tree.h> #include <libxslt/transform.h> @@ -36,30 +35,31 @@ namespace WebCore { class ResourceFetcher; class XSLImportRule; -class XSLStyleSheet : public StyleSheet { +class XSLStyleSheet FINAL : public StyleSheet { public: - static PassRefPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL) + static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL) { ASSERT(RuntimeEnabledFeatures::xsltEnabled()); - return adoptRef(new XSLStyleSheet(parentImport, originalURL, finalURL)); + return adoptRefWillBeNoop(new XSLStyleSheet(parentImport, originalURL, finalURL)); } - static PassRefPtr<XSLStyleSheet> create(ProcessingInstruction* parentNode, const String& originalURL, const KURL& finalURL) + static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(ProcessingInstruction* parentNode, const String& originalURL, const KURL& finalURL) { ASSERT(RuntimeEnabledFeatures::xsltEnabled()); - return adoptRef(new XSLStyleSheet(parentNode, originalURL, finalURL, false)); + return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, finalURL, false)); } - static PassRefPtr<XSLStyleSheet> createEmbedded(ProcessingInstruction* parentNode, const KURL& finalURL) + static PassRefPtrWillBeRawPtr<XSLStyleSheet> createEmbedded(ProcessingInstruction* parentNode, const KURL& finalURL) { ASSERT(RuntimeEnabledFeatures::xsltEnabled()); - return adoptRef(new XSLStyleSheet(parentNode, finalURL.string(), finalURL, true)); + return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, finalURL.string(), finalURL, true)); } - // Taking an arbitrary node is unsafe, because owner node pointer can become stale. - // XSLTProcessor ensures that the stylesheet doesn't outlive its parent, in part by not exposing it to JavaScript. - static PassRefPtr<XSLStyleSheet> createForXSLTProcessor(Node* parentNode, const String& originalURL, const KURL& finalURL) + // Taking an arbitrary node is unsafe, because owner node pointer can become + // stale. XSLTProcessor ensures that the stylesheet doesn't outlive its + // parent, in part by not exposing it to JavaScript. + static PassRefPtrWillBeRawPtr<XSLStyleSheet> createForXSLTProcessor(Node* parentNode, const String& originalURL, const KURL& finalURL) { ASSERT(RuntimeEnabledFeatures::xsltEnabled()); - return adoptRef(new XSLStyleSheet(parentNode, originalURL, finalURL, false)); + return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, finalURL, false)); } virtual ~XSLStyleSheet(); @@ -77,7 +77,7 @@ public: Document* ownerDocument(); virtual XSLStyleSheet* parentStyleSheet() const OVERRIDE { return m_parentStyleSheet; } - void setParentStyleSheet(XSLStyleSheet* parent); + void setParentStyleSheet(XSLStyleSheet*); xmlDocPtr document(); xsltStylesheetPtr compileStyleSheet(); @@ -95,20 +95,22 @@ public: virtual String href() const OVERRIDE { return m_originalURL; } virtual String title() const OVERRIDE { return emptyString(); } - virtual void clearOwnerNode() OVERRIDE { m_ownerNode = 0; } + virtual void clearOwnerNode() OVERRIDE { m_ownerNode = nullptr; } virtual KURL baseURL() const OVERRIDE { return m_finalURL; } virtual bool isLoading() const OVERRIDE; + virtual void trace(Visitor*) OVERRIDE; + private: XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded); XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL); - Node* m_ownerNode; + RawPtrWillBeMember<Node> m_ownerNode; String m_originalURL; KURL m_finalURL; bool m_isDisabled; - Vector<OwnPtr<XSLImportRule> > m_children; + WillBeHeapVector<OwnPtrWillBeMember<XSLImportRule> > m_children; bool m_embedded; bool m_processed; @@ -117,7 +119,7 @@ private: bool m_stylesheetDocTaken; bool m_compilationFailed; - XSLStyleSheet* m_parentStyleSheet; + RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; }; DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !sheet.isCSSStyleSheet()); |