| 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, 2008, 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "core/xml/parser/SharedBufferReader.h" | 59 #include "core/xml/parser/SharedBufferReader.h" |
| 60 #include "core/xml/parser/XMLDocumentParserScope.h" | 60 #include "core/xml/parser/XMLDocumentParserScope.h" |
| 61 #include "core/xml/parser/XMLParserInput.h" | 61 #include "core/xml/parser/XMLParserInput.h" |
| 62 #include "platform/RuntimeEnabledFeatures.h" | 62 #include "platform/RuntimeEnabledFeatures.h" |
| 63 #include "platform/SharedBuffer.h" | 63 #include "platform/SharedBuffer.h" |
| 64 #include "platform/TraceEvent.h" | 64 #include "platform/TraceEvent.h" |
| 65 #include "platform/network/ResourceError.h" | 65 #include "platform/network/ResourceError.h" |
| 66 #include "platform/network/ResourceRequest.h" | 66 #include "platform/network/ResourceRequest.h" |
| 67 #include "platform/network/ResourceResponse.h" | 67 #include "platform/network/ResourceResponse.h" |
| 68 #include "platform/weborigin/SecurityOrigin.h" | 68 #include "platform/weborigin/SecurityOrigin.h" |
| 69 #include "wtf/AutoReset.h" |
| 69 #include "wtf/PtrUtil.h" | 70 #include "wtf/PtrUtil.h" |
| 70 #include "wtf/StringExtras.h" | 71 #include "wtf/StringExtras.h" |
| 71 #include "wtf/TemporaryChange.h" | |
| 72 #include "wtf/Threading.h" | 72 #include "wtf/Threading.h" |
| 73 #include "wtf/Vector.h" | 73 #include "wtf/Vector.h" |
| 74 #include "wtf/text/UTF8.h" | 74 #include "wtf/text/UTF8.h" |
| 75 #include <libxml/catalog.h> | 75 #include <libxml/catalog.h> |
| 76 #include <libxml/parser.h> | 76 #include <libxml/parser.h> |
| 77 #include <libxml/parserInternals.h> | 77 #include <libxml/parserInternals.h> |
| 78 #include <libxslt/xslt.h> | 78 #include <libxslt/xslt.h> |
| 79 #include <memory> | 79 #include <memory> |
| 80 | 80 |
| 81 namespace blink { | 81 namespace blink { |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 if (!m_context) | 863 if (!m_context) |
| 864 initializeParserContext(); | 864 initializeParserContext(); |
| 865 | 865 |
| 866 // Protect the libxml context from deletion during a callback | 866 // Protect the libxml context from deletion during a callback |
| 867 RefPtr<XMLParserContext> context = m_context; | 867 RefPtr<XMLParserContext> context = m_context; |
| 868 | 868 |
| 869 // libXML throws an error if you try to switch the encoding for an empty | 869 // libXML throws an error if you try to switch the encoding for an empty |
| 870 // string. | 870 // string. |
| 871 if (parseString.length()) { | 871 if (parseString.length()) { |
| 872 XMLDocumentParserScope scope(document()); | 872 XMLDocumentParserScope scope(document()); |
| 873 TemporaryChange<bool> encodingScope(m_isCurrentlyParsing8BitChunk, parse
String.is8Bit()); | 873 AutoReset<bool> encodingScope(&m_isCurrentlyParsing8BitChunk, parseStrin
g.is8Bit()); |
| 874 parseChunk(context->context(), parseString); | 874 parseChunk(context->context(), parseString); |
| 875 | 875 |
| 876 // JavaScript (which may be run under the parseChunk callstack) may | 876 // JavaScript (which may be run under the parseChunk callstack) may |
| 877 // cause the parser to be stopped or detached. | 877 // cause the parser to be stopped or detached. |
| 878 if (isStopped()) | 878 if (isStopped()) |
| 879 return; | 879 return; |
| 880 } | 880 } |
| 881 | 881 |
| 882 // FIXME: Why is this here? And why is it after we process the passed | 882 // FIXME: Why is this here? And why is it after we process the passed |
| 883 // source? | 883 // source? |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 sax.initialized = XML_SAX2_MAGIC; | 1640 sax.initialized = XML_SAX2_MAGIC; |
| 1641 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1641 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1642 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1642 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1643 parseChunk(parser->context(), parseString); | 1643 parseChunk(parser->context(), parseString); |
| 1644 finishParsing(parser->context()); | 1644 finishParsing(parser->context()); |
| 1645 attrsOK = state.gotAttributes; | 1645 attrsOK = state.gotAttributes; |
| 1646 return state.attributes; | 1646 return state.attributes; |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 } // namespace blink | 1649 } // namespace blink |
| OLD | NEW |