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" |
44 #include "wtf/Assertions.h" | 45 #include "wtf/Assertions.h" |
45 #include "wtf/Vector.h" | 46 #include "wtf/Vector.h" |
46 #include "wtf/text/CString.h" | 47 #include "wtf/text/CString.h" |
47 #include "wtf/text/StringBuffer.h" | 48 #include "wtf/text/StringBuffer.h" |
48 #include "wtf/unicode/UTF8.h" | 49 #include "wtf/unicode/UTF8.h" |
49 #include <libxslt/imports.h> | 50 #include <libxslt/imports.h> |
50 #include <libxslt/security.h> | 51 #include <libxslt/security.h> |
51 #include <libxslt/variables.h> | 52 #include <libxslt/variables.h> |
52 #include <libxslt/xsltutils.h> | 53 #include <libxslt/xsltutils.h> |
53 | 54 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 switch (type) { | 96 switch (type) { |
96 case XSLT_LOAD_DOCUMENT: { | 97 case XSLT_LOAD_DOCUMENT: { |
97 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; | 98 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; |
98 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); | 99 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); |
99 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); | 100 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); |
100 xmlFree(base); | 101 xmlFree(base); |
101 | 102 |
102 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); | 103 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); |
103 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); | 104 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); |
| 105 request.mutableResourceRequest().setRequestContext(blink::WebURLRequest:
:RequestContextXSLT); |
104 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); | 106 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); |
105 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous
ly(request); | 107 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous
ly(request); |
106 if (!resource || !globalProcessor) | 108 if (!resource || !globalProcessor) |
107 return 0; | 109 return 0; |
108 | 110 |
109 FrameConsole* console = 0; | 111 FrameConsole* console = 0; |
110 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); | 112 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); |
111 if (frame) | 113 if (frame) |
112 console = &frame->console(); | 114 console = &frame->console(); |
113 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); | 115 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 345 |
344 sheet->method = origMethod; | 346 sheet->method = origMethod; |
345 setXSLTLoadCallBack(0, 0, 0); | 347 setXSLTLoadCallBack(0, 0, 0); |
346 xsltFreeStylesheet(sheet); | 348 xsltFreeStylesheet(sheet); |
347 m_stylesheet = nullptr; | 349 m_stylesheet = nullptr; |
348 | 350 |
349 return success; | 351 return success; |
350 } | 352 } |
351 | 353 |
352 } // namespace blink | 354 } // namespace blink |
OLD | NEW |