OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the XSL implementation. | 2 * This file is part of the XSL implementation. |
3 * | 3 * |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. |
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
35 #include "core/xml/XSLStyleSheet.h" | 35 #include "core/xml/XSLStyleSheet.h" |
36 #include "core/xml/XSLTExtensions.h" | 36 #include "core/xml/XSLTExtensions.h" |
37 #include "core/xml/XSLTUnicodeSort.h" | 37 #include "core/xml/XSLTUnicodeSort.h" |
38 #include "core/xml/parser/XMLDocumentParser.h" | 38 #include "core/xml/parser/XMLDocumentParser.h" |
39 #include "platform/SharedBuffer.h" | 39 #include "platform/SharedBuffer.h" |
40 #include "platform/network/ResourceError.h" | 40 #include "platform/network/ResourceError.h" |
41 #include "platform/network/ResourceRequest.h" | 41 #include "platform/network/ResourceRequest.h" |
42 #include "platform/network/ResourceResponse.h" | 42 #include "platform/network/ResourceResponse.h" |
43 #include "platform/weborigin/SecurityOrigin.h" | 43 #include "platform/weborigin/SecurityOrigin.h" |
44 #include "public/platform/WebURLRequest.h" | |
45 #include "wtf/Assertions.h" | 44 #include "wtf/Assertions.h" |
46 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
47 #include "wtf/text/CString.h" | 46 #include "wtf/text/CString.h" |
48 #include "wtf/text/StringBuffer.h" | 47 #include "wtf/text/StringBuffer.h" |
49 #include "wtf/unicode/UTF8.h" | 48 #include "wtf/unicode/UTF8.h" |
50 #include <libxslt/imports.h> | 49 #include <libxslt/imports.h> |
51 #include <libxslt/security.h> | 50 #include <libxslt/security.h> |
52 #include <libxslt/variables.h> | 51 #include <libxslt/variables.h> |
53 #include <libxslt/xsltutils.h> | 52 #include <libxslt/xsltutils.h> |
54 | 53 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 94 |
96 switch (type) { | 95 switch (type) { |
97 case XSLT_LOAD_DOCUMENT: { | 96 case XSLT_LOAD_DOCUMENT: { |
98 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; | 97 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; |
99 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); | 98 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); |
100 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); | 99 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); |
101 xmlFree(base); | 100 xmlFree(base); |
102 | 101 |
103 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); | 102 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); |
104 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); | 103 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); |
105 request.mutableResourceRequest().setRequestContext(blink::WebURLRequest:
:RequestContextXSLT); | |
106 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); | 104 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); |
107 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous
ly(request); | 105 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous
ly(request); |
108 if (!resource || !globalProcessor) | 106 if (!resource || !globalProcessor) |
109 return 0; | 107 return 0; |
110 | 108 |
111 FrameConsole* console = 0; | 109 FrameConsole* console = 0; |
112 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); | 110 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); |
113 if (frame) | 111 if (frame) |
114 console = &frame->console(); | 112 console = &frame->console(); |
115 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); | 113 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 343 |
346 sheet->method = origMethod; | 344 sheet->method = origMethod; |
347 setXSLTLoadCallBack(0, 0, 0); | 345 setXSLTLoadCallBack(0, 0, 0); |
348 xsltFreeStylesheet(sheet); | 346 xsltFreeStylesheet(sheet); |
349 m_stylesheet = nullptr; | 347 m_stylesheet = nullptr; |
350 | 348 |
351 return success; | 349 return success; |
352 } | 350 } |
353 | 351 |
354 } // namespace blink | 352 } // namespace blink |
OLD | NEW |