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

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

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove RequestOriginPolicy + suggested improvements Created 7 years, 1 month 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
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.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return 0; 95 return 0;
96 96
97 switch (type) { 97 switch (type) {
98 case XSLT_LOAD_DOCUMENT: { 98 case XSLT_LOAD_DOCUMENT: {
99 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; 99 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
100 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); 100 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
101 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei nterpret_cast<const char*>(uri)); 101 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei nterpret_cast<const char*>(uri));
102 xmlFree(base); 102 xmlFree(base);
103 103
104 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio ns()); 104 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio ns());
105 fetchOptions.requestOriginPolicy = RestrictToSameOrigin;
106 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions); 105 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions);
107 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous ly(request); 106 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous ly(request, RestrictToSameOrigin);
108 if (!resource || !globalProcessor) 107 if (!resource || !globalProcessor)
109 return 0; 108 return 0;
110 109
111 PageConsole* console = 0; 110 PageConsole* console = 0;
112 Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame( ); 111 Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame( );
113 if (frame && frame->page()) 112 if (frame && frame->page())
114 console = &frame->page()->console(); 113 console = &frame->page()->console();
115 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); 114 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
116 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); 115 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
117 116
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 337
339 sheet->method = origMethod; 338 sheet->method = origMethod;
340 setXSLTLoadCallBack(0, 0, 0); 339 setXSLTLoadCallBack(0, 0, 0);
341 xsltFreeStylesheet(sheet); 340 xsltFreeStylesheet(sheet);
342 m_stylesheet = 0; 341 m_stylesheet = 0;
343 342
344 return success; 343 return success;
345 } 344 }
346 345
347 } // namespace WebCore 346 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698