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 11 matching lines...) Expand all Loading... | |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef XMLDocumentParser_h | 25 #ifndef XMLDocumentParser_h |
26 #define XMLDocumentParser_h | 26 #define XMLDocumentParser_h |
27 | 27 |
28 #include "core/dom/ParserContentPolicy.h" | 28 #include "core/dom/ParserContentPolicy.h" |
29 #include "core/dom/ScriptableDocumentParser.h" | 29 #include "core/dom/ScriptableDocumentParser.h" |
30 #include "core/fetch/ResourceClient.h" | 30 #include "core/fetch/ResourceClient.h" |
31 #include "core/fetch/ResourcePtr.h" | 31 #include "core/fetch/ResourcePtr.h" |
32 #include "core/fetch/ScriptResource.h" | |
32 #include "core/xml/parser/XMLErrors.h" | 33 #include "core/xml/parser/XMLErrors.h" |
33 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
34 #include "platform/text/SegmentedString.h" | 35 #include "platform/text/SegmentedString.h" |
35 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
36 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
37 #include "wtf/text/CString.h" | 38 #include "wtf/text/CString.h" |
38 #include "wtf/text/StringHash.h" | 39 #include "wtf/text/StringHash.h" |
39 #include <libxml/tree.h> | 40 #include <libxml/tree.h> |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class ContainerNode; | 44 class ContainerNode; |
44 class ScriptResource; | |
45 class ResourceFetcher; | 45 class ResourceFetcher; |
46 class DocumentFragment; | 46 class DocumentFragment; |
47 class Document; | 47 class Document; |
48 class Element; | 48 class Element; |
49 class FrameView; | 49 class FrameView; |
50 class Text; | 50 class Text; |
51 | 51 |
52 class XMLParserContext : public RefCounted<XMLParserContext> { | 52 class XMLParserContext : public RefCounted<XMLParserContext> { |
53 public: | 53 public: |
54 static PassRefPtr<XMLParserContext> createMemoryParser(xmlSAXHandlerPtr, voi d* userData, const CString& chunk); | 54 static PassRefPtr<XMLParserContext> createMemoryParser(xmlSAXHandlerPtr, voi d* userData, const CString& chunk); |
55 static PassRefPtr<XMLParserContext> createStringParser(xmlSAXHandlerPtr, voi d* userData); | 55 static PassRefPtr<XMLParserContext> createStringParser(xmlSAXHandlerPtr, voi d* userData); |
56 ~XMLParserContext(); | 56 ~XMLParserContext(); |
57 xmlParserCtxtPtr context() const { return m_context; } | 57 xmlParserCtxtPtr context() const { return m_context; } |
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 Resource Client { | 68 class XMLDocumentParser FINAL : public ScriptableDocumentParser, public ScriptRe sourceClient { |
haraken
2014/08/17 16:05:28
Why does XMLDocumentParser need to be a ScriptReso
marja
2014/08/20 11:45:57
Because it's added as a client to ScriptResources.
| |
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 } |
(...skipping 113 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 |