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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 { | 641 { |
642 DCHECK(XMLDocumentParserScope::currentDocument); | 642 DCHECK(XMLDocumentParserScope::currentDocument); |
643 DCHECK_EQ(currentThread(), libxmlLoaderThread); | 643 DCHECK_EQ(currentThread(), libxmlLoaderThread); |
644 | 644 |
645 KURL url(KURL(), uri); | 645 KURL url(KURL(), uri); |
646 | 646 |
647 if (!shouldAllowExternalLoad(url)) | 647 if (!shouldAllowExternalLoad(url)) |
648 return &globalDescriptor; | 648 return &globalDescriptor; |
649 | 649 |
650 KURL finalURL; | 650 KURL finalURL; |
651 RefPtr<SharedBuffer> data; | 651 RefPtr<const SharedBuffer> data; |
652 | 652 |
653 { | 653 { |
654 Document* document = XMLDocumentParserScope::currentDocument; | 654 Document* document = XMLDocumentParserScope::currentDocument; |
655 XMLDocumentParserScope scope(0); | 655 XMLDocumentParserScope scope(0); |
656 // FIXME: We should restore the original global error handler as well. | 656 // FIXME: We should restore the original global error handler as well. |
657 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
ResourceFetcher::defaultResourceOptions()); | 657 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
ResourceFetcher::defaultResourceOptions()); |
658 Resource* resource = RawResource::fetchSynchronously(request, document->
fetcher()); | 658 Resource* resource = RawResource::fetchSynchronously(request, document->
fetcher()); |
659 if (resource && !resource->errorOccurred()) { | 659 if (resource && !resource->errorOccurred()) { |
660 data = resource->resourceBuffer(); | 660 data = resource->resourceBuffer(); |
661 finalURL = resource->response().url(); | 661 finalURL = resource->response().url(); |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 sax.initialized = XML_SAX2_MAGIC; | 1651 sax.initialized = XML_SAX2_MAGIC; |
1652 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1652 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1653 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1653 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1654 parseChunk(parser->context(), parseString); | 1654 parseChunk(parser->context(), parseString); |
1655 finishParsing(parser->context()); | 1655 finishParsing(parser->context()); |
1656 attrsOK = state.gotAttributes; | 1656 attrsOK = state.gotAttributes; |
1657 return state.attributes; | 1657 return state.attributes; |
1658 } | 1658 } |
1659 | 1659 |
1660 } // namespace blink | 1660 } // namespace blink |
OLD | NEW |