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

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

Issue 2220543002: Make Resource::resourceBuffer() to return PassRefPtr<const SharedBuffer> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WTF_UseIsConvertibleInEnsure
Patch Set: Rebase Created 4 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
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 { 641 {
642 DCHECK(XMLDocumentParserScope::currentDocument); 642 DCHECK(XMLDocumentParserScope::currentDocument);
643 DCHECK_EQ(currentThread(), libxmlLoaderThread); 643 DCHECK_EQ(currentThread(), libxmlLoaderThread);
644 644
645 KURL url(KURL(), uri); 645 KURL url(KURL(), uri);
646 646
647 if (!shouldAllowExternalLoad(url)) 647 if (!shouldAllowExternalLoad(url))
648 return &globalDescriptor; 648 return &globalDescriptor;
649 649
650 KURL finalURL; 650 KURL finalURL;
651 RefPtr<SharedBuffer> data; 651 RefPtr<const SharedBuffer> data;
652 652
653 { 653 {
654 Document* document = XMLDocumentParserScope::currentDocument; 654 Document* document = XMLDocumentParserScope::currentDocument;
655 XMLDocumentParserScope scope(0); 655 XMLDocumentParserScope scope(0);
656 // FIXME: We should restore the original global error handler as well. 656 // FIXME: We should restore the original global error handler as well.
657 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, ResourceFetcher::defaultResourceOptions()); 657 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, ResourceFetcher::defaultResourceOptions());
658 Resource* resource = RawResource::fetchSynchronously(request, document-> fetcher()); 658 Resource* resource = RawResource::fetchSynchronously(request, document-> fetcher());
659 if (resource && !resource->errorOccurred()) { 659 if (resource && !resource->errorOccurred()) {
660 data = resource->resourceBuffer(); 660 data = resource->resourceBuffer();
661 finalURL = resource->response().url(); 661 finalURL = resource->response().url();
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 sax.initialized = XML_SAX2_MAGIC; 1651 sax.initialized = XML_SAX2_MAGIC;
1652 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1652 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1653 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1653 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1654 parseChunk(parser->context(), parseString); 1654 parseChunk(parser->context(), parseString);
1655 finishParsing(parser->context()); 1655 finishParsing(parser->context());
1656 attrsOK = state.gotAttributes; 1656 attrsOK = state.gotAttributes;
1657 return state.attributes; 1657 return state.attributes;
1658 } 1658 }
1659 1659
1660 } // namespace blink 1660 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698