Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: Source/core/xml/XSLTProcessorLibxslt.cpp

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XSLImportRule.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 */ 21 */
22 22
23 #include "config.h" 23 #include "config.h"
24 #include "core/xml/XSLTProcessor.h" 24 #include "core/xml/XSLTProcessor.h"
25 25
26 #include "core/dom/Document.h" 26 #include "core/dom/Document.h"
27 #include "core/dom/TransformSource.h" 27 #include "core/dom/TransformSource.h"
28 #include "core/editing/markup.h" 28 #include "core/editing/markup.h"
29 #include "core/fetch/FetchInitiatorTypeNames.h" 29 #include "core/fetch/FetchInitiatorTypeNames.h"
30 #include "core/fetch/RawResource.h"
30 #include "core/fetch/Resource.h" 31 #include "core/fetch/Resource.h"
31 #include "core/fetch/ResourceFetcher.h" 32 #include "core/fetch/ResourceFetcher.h"
32 #include "core/frame/FrameConsole.h" 33 #include "core/frame/FrameConsole.h"
33 #include "core/frame/FrameHost.h" 34 #include "core/frame/FrameHost.h"
34 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
35 #include "core/inspector/ConsoleMessage.h" 36 #include "core/inspector/ConsoleMessage.h"
36 #include "core/xml/XSLStyleSheet.h" 37 #include "core/xml/XSLStyleSheet.h"
37 #include "core/xml/XSLTExtensions.h" 38 #include "core/xml/XSLTExtensions.h"
38 #include "core/xml/XSLTUnicodeSort.h" 39 #include "core/xml/XSLTUnicodeSort.h"
39 #include "core/xml/parser/XMLDocumentParser.h" 40 #include "core/xml/parser/XMLDocumentParser.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
104 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); 105 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin);
105 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous ly(request); 106 ResourcePtr<Resource> resource = RawResource::fetchSynchronously(request , globalResourceFetcher);
106 if (!resource || !globalProcessor) 107 if (!resource || !globalProcessor)
107 return nullptr; 108 return nullptr;
108 109
109 FrameConsole* console = nullptr; 110 FrameConsole* console = nullptr;
110 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f rame(); 111 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f rame();
111 if (frame) 112 if (frame)
112 console = &frame->console(); 113 console = &frame->console();
113 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); 114 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
114 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); 115 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
115 116
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 345
345 sheet->method = origMethod; 346 sheet->method = origMethod;
346 setXSLTLoadCallBack(0, 0, 0); 347 setXSLTLoadCallBack(0, 0, 0);
347 xsltFreeStylesheet(sheet); 348 xsltFreeStylesheet(sheet);
348 m_stylesheet = nullptr; 349 m_stylesheet = nullptr;
349 350
350 return success; 351 return success;
351 } 352 }
352 353
353 } // namespace blink 354 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XSLImportRule.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698