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

Side by Side Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 398313002: Teach ContentSecurityPolicy about WebURLRequest::RequestContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: UseCounter Created 6 years, 5 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/XSLTProcessorLibxslt.cpp ('k') | Source/web/tests/WebFrameTest.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 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "core/xml/XMLTreeViewer.h" 55 #include "core/xml/XMLTreeViewer.h"
56 #include "core/xml/parser/SharedBufferReader.h" 56 #include "core/xml/parser/SharedBufferReader.h"
57 #include "core/xml/parser/XMLDocumentParserScope.h" 57 #include "core/xml/parser/XMLDocumentParserScope.h"
58 #include "core/xml/parser/XMLParserInput.h" 58 #include "core/xml/parser/XMLParserInput.h"
59 #include "platform/RuntimeEnabledFeatures.h" 59 #include "platform/RuntimeEnabledFeatures.h"
60 #include "platform/SharedBuffer.h" 60 #include "platform/SharedBuffer.h"
61 #include "platform/TraceEvent.h" 61 #include "platform/TraceEvent.h"
62 #include "platform/network/ResourceError.h" 62 #include "platform/network/ResourceError.h"
63 #include "platform/network/ResourceRequest.h" 63 #include "platform/network/ResourceRequest.h"
64 #include "platform/network/ResourceResponse.h" 64 #include "platform/network/ResourceResponse.h"
65 #include "platform/weborigin/SecurityOrigin.h" 65 #include "public/platform/WebURLRequest.h"
66 #include "wtf/StringExtras.h" 66 #include "wtf/StringExtras.h"
67 #include "wtf/TemporaryChange.h" 67 #include "wtf/TemporaryChange.h"
68 #include "wtf/Threading.h" 68 #include "wtf/Threading.h"
69 #include "wtf/Vector.h" 69 #include "wtf/Vector.h"
70 #include "wtf/unicode/UTF8.h" 70 #include "wtf/unicode/UTF8.h"
71 #include <libxml/catalog.h> 71 #include <libxml/catalog.h>
72 #include <libxml/parser.h> 72 #include <libxml/parser.h>
73 #include <libxml/parserInternals.h> 73 #include <libxml/parserInternals.h>
74 #include <libxslt/xslt.h> 74 #include <libxslt/xslt.h>
75 75
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 KURL finalURL; 631 KURL finalURL;
632 RefPtr<SharedBuffer> data; 632 RefPtr<SharedBuffer> data;
633 633
634 { 634 {
635 ResourceFetcher* fetcher = XMLDocumentParserScope::currentFetcher; 635 ResourceFetcher* fetcher = XMLDocumentParserScope::currentFetcher;
636 XMLDocumentParserScope scope(0); 636 XMLDocumentParserScope scope(0);
637 // FIXME: We should restore the original global error handler as well. 637 // FIXME: We should restore the original global error handler as well.
638 638
639 if (fetcher->frame()) { 639 if (fetcher->frame()) {
640 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames:: xml, ResourceFetcher::defaultResourceOptions()); 640 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames:: xml, ResourceFetcher::defaultResourceOptions());
641 request.mutableResourceRequest().setRequestContext(blink::WebURLRequ est::RequestContextXSLT);
641 ResourcePtr<Resource> resource = fetcher->fetchSynchronously(request ); 642 ResourcePtr<Resource> resource = fetcher->fetchSynchronously(request );
642 if (resource && !resource->errorOccurred()) { 643 if (resource && !resource->errorOccurred()) {
643 data = resource->resourceBuffer(); 644 data = resource->resourceBuffer();
644 finalURL = resource->response().url(); 645 finalURL = resource->response().url();
645 } 646 }
646 } 647 }
647 } 648 }
648 649
649 // We have to check the URL again after the load to catch redirects. 650 // We have to check the URL again after the load to catch redirects.
650 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>. 651 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 sax.initialized = XML_SAX2_MAGIC; 1632 sax.initialized = XML_SAX2_MAGIC;
1632 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1633 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1633 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1634 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1634 parseChunk(parser->context(), parseString); 1635 parseChunk(parser->context(), parseString);
1635 finishParsing(parser->context()); 1636 finishParsing(parser->context());
1636 attrsOK = state.gotAttributes; 1637 attrsOK = state.gotAttributes;
1637 return state.attributes; 1638 return state.attributes;
1638 } 1639 }
1639 1640
1640 } // namespace blink 1641 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XSLTProcessorLibxslt.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698