| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 4 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 5 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 5 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 XMLParserContext(xmlParserCtxtPtr context) | 60 XMLParserContext(xmlParserCtxtPtr context) |
| 61 : m_context(context) | 61 : m_context(context) |
| 62 { | 62 { |
| 63 } | 63 } |
| 64 | 64 |
| 65 xmlParserCtxtPtr m_context; | 65 xmlParserCtxtPtr m_context; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class XMLDocumentParser FINAL : public ScriptableDocumentParser, public ScriptRe
sourceClient { | 68 class XMLDocumentParser final : public ScriptableDocumentParser, public ScriptRe
sourceClient { |
| 69 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 69 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 70 public: | 70 public: |
| 71 static PassRefPtrWillBeRawPtr<XMLDocumentParser> create(Document& document,
FrameView* view) | 71 static PassRefPtrWillBeRawPtr<XMLDocumentParser> create(Document& document,
FrameView* view) |
| 72 { | 72 { |
| 73 return adoptRefWillBeNoop(new XMLDocumentParser(document, view)); | 73 return adoptRefWillBeNoop(new XMLDocumentParser(document, view)); |
| 74 } | 74 } |
| 75 static PassRefPtrWillBeRawPtr<XMLDocumentParser> create(DocumentFragment* fr
agment, Element* element, ParserContentPolicy parserContentPolicy) | 75 static PassRefPtrWillBeRawPtr<XMLDocumentParser> create(DocumentFragment* fr
agment, Element* element, ParserContentPolicy parserContentPolicy) |
| 76 { | 76 { |
| 77 return adoptRefWillBeNoop(new XMLDocumentParser(fragment, element, parse
rContentPolicy)); | 77 return adoptRefWillBeNoop(new XMLDocumentParser(fragment, element, parse
rContentPolicy)); |
| 78 } | 78 } |
| 79 virtual ~XMLDocumentParser(); | 79 virtual ~XMLDocumentParser(); |
| 80 virtual void trace(Visitor*) OVERRIDE; | 80 virtual void trace(Visitor*) override; |
| 81 | 81 |
| 82 // Exposed for callbacks: | 82 // Exposed for callbacks: |
| 83 void handleError(XMLErrors::ErrorType, const char* message, TextPosition); | 83 void handleError(XMLErrors::ErrorType, const char* message, TextPosition); |
| 84 | 84 |
| 85 void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; } | 85 void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; } |
| 86 bool isXHTMLDocument() const { return m_isXHTMLDocument; } | 86 bool isXHTMLDocument() const { return m_isXHTMLDocument; } |
| 87 | 87 |
| 88 bool isCurrentlyParsing8BitChunk() { return m_isCurrentlyParsing8BitChunk; } | 88 bool isCurrentlyParsing8BitChunk() { return m_isCurrentlyParsing8BitChunk; } |
| 89 | 89 |
| 90 static bool parseDocumentFragment(const String&, DocumentFragment*, Element*
parent = 0, ParserContentPolicy = AllowScriptingContent); | 90 static bool parseDocumentFragment(const String&, DocumentFragment*, Element*
parent = 0, ParserContentPolicy = AllowScriptingContent); |
| 91 | 91 |
| 92 // Used by the XMLHttpRequest to check if the responseXML was well formed. | 92 // Used by the XMLHttpRequest to check if the responseXML was well formed. |
| 93 virtual bool wellFormed() const OVERRIDE { return !m_sawError; } | 93 virtual bool wellFormed() const override { return !m_sawError; } |
| 94 | 94 |
| 95 virtual TextPosition textPosition() const OVERRIDE; | 95 virtual TextPosition textPosition() const override; |
| 96 | 96 |
| 97 static bool supportsXMLVersion(const String&); | 97 static bool supportsXMLVersion(const String&); |
| 98 | 98 |
| 99 class PendingCallback { | 99 class PendingCallback { |
| 100 public: | 100 public: |
| 101 virtual ~PendingCallback() { } | 101 virtual ~PendingCallback() { } |
| 102 virtual void call(XMLDocumentParser*) = 0; | 102 virtual void call(XMLDocumentParser*) = 0; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 explicit XMLDocumentParser(Document&, FrameView* = 0); | 106 explicit XMLDocumentParser(Document&, FrameView* = 0); |
| 107 XMLDocumentParser(DocumentFragment*, Element*, ParserContentPolicy); | 107 XMLDocumentParser(DocumentFragment*, Element*, ParserContentPolicy); |
| 108 | 108 |
| 109 // From DocumentParser | 109 // From DocumentParser |
| 110 virtual void insert(const SegmentedString&) OVERRIDE; | 110 virtual void insert(const SegmentedString&) override; |
| 111 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; | 111 virtual void append(PassRefPtr<StringImpl>) override; |
| 112 virtual void finish() OVERRIDE; | 112 virtual void finish() override; |
| 113 virtual bool isWaitingForScripts() const OVERRIDE; | 113 virtual bool isWaitingForScripts() const override; |
| 114 virtual void stopParsing() OVERRIDE; | 114 virtual void stopParsing() override; |
| 115 virtual void detach() OVERRIDE; | 115 virtual void detach() override; |
| 116 virtual OrdinalNumber lineNumber() const OVERRIDE; | 116 virtual OrdinalNumber lineNumber() const override; |
| 117 OrdinalNumber columnNumber() const; | 117 OrdinalNumber columnNumber() const; |
| 118 | 118 |
| 119 // from ResourceClient | 119 // from ResourceClient |
| 120 virtual void notifyFinished(Resource*) OVERRIDE; | 120 virtual void notifyFinished(Resource*) override; |
| 121 | 121 |
| 122 void end(); | 122 void end(); |
| 123 | 123 |
| 124 void pauseParsing(); | 124 void pauseParsing(); |
| 125 void resumeParsing(); | 125 void resumeParsing(); |
| 126 | 126 |
| 127 bool appendFragmentSource(const String&); | 127 bool appendFragmentSource(const String&); |
| 128 | 128 |
| 129 public: | 129 public: |
| 130 // Callbacks from parser SAX | 130 // Callbacks from parser SAX |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 PrefixForNamespaceMap m_prefixToNamespaceMap; | 192 PrefixForNamespaceMap m_prefixToNamespaceMap; |
| 193 SegmentedString m_pendingSrc; | 193 SegmentedString m_pendingSrc; |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 xmlDocPtr xmlDocPtrForString(ResourceFetcher*, const String& source, const Strin
g& url); | 196 xmlDocPtr xmlDocPtrForString(ResourceFetcher*, const String& source, const Strin
g& url); |
| 197 HashMap<String, String> parseAttributes(const String&, bool& attrsOK); | 197 HashMap<String, String> parseAttributes(const String&, bool& attrsOK); |
| 198 | 198 |
| 199 } // namespace blink | 199 } // namespace blink |
| 200 | 200 |
| 201 #endif // XMLDocumentParser_h | 201 #endif // XMLDocumentParser_h |
| OLD | NEW |