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

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

Issue 552673002: Added UseCounter for XML external DTD. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 3 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/frame/UseCounter.h ('k') | no next file » | 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, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008, 2014 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 finalURL = resource->response().url(); 650 finalURL = resource->response().url();
651 } 651 }
652 } 652 }
653 } 653 }
654 654
655 // We have to check the URL again after the load to catch redirects. 655 // We have to check the URL again after the load to catch redirects.
656 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>. 656 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
657 if (!shouldAllowExternalLoad(finalURL)) 657 if (!shouldAllowExternalLoad(finalURL))
658 return &globalDescriptor; 658 return &globalDescriptor;
659 659
660 UseCounter::count(XMLDocumentParserScope::currentFetcher->document(), UseCou nter::XMLExternalResourceLoad);
661
660 return new SharedBufferReader(data); 662 return new SharedBufferReader(data);
661 } 663 }
662 664
663 static int readFunc(void* context, char* buffer, int len) 665 static int readFunc(void* context, char* buffer, int len)
664 { 666 {
665 // Do 0-byte reads in case of a null descriptor 667 // Do 0-byte reads in case of a null descriptor
666 if (context == &globalDescriptor) 668 if (context == &globalDescriptor)
667 return 0; 669 return 0;
668 670
669 SharedBufferReader* data = static_cast<SharedBufferReader*>(context); 671 SharedBufferReader* data = static_cast<SharedBufferReader*>(context);
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 sax.initialized = XML_SAX2_MAGIC; 1637 sax.initialized = XML_SAX2_MAGIC;
1636 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1638 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1637 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1639 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1638 parseChunk(parser->context(), parseString); 1640 parseChunk(parser->context(), parseString);
1639 finishParsing(parser->context()); 1641 finishParsing(parser->context());
1640 attrsOK = state.gotAttributes; 1642 attrsOK = state.gotAttributes;
1641 return state.attributes; 1643 return state.attributes;
1642 } 1644 }
1643 1645
1644 } // namespace blink 1646 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698