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

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

Issue 24009002: Move synchronously fetching to ResourceFetcher, as well as most of the logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 ResourceResponse response; 641 ResourceResponse response;
642 Vector<char> data; 642 Vector<char> data;
643 643
644 644
645 { 645 {
646 ResourceFetcher* fetcher = XMLDocumentParserScope::currentFetcher; 646 ResourceFetcher* fetcher = XMLDocumentParserScope::currentFetcher;
647 XMLDocumentParserScope scope(0); 647 XMLDocumentParserScope scope(0);
648 // FIXME: We should restore the original global error handler as well. 648 // FIXME: We should restore the original global error handler as well.
649 649
650 if (fetcher->frame()) 650 if (fetcher->frame())
651 fetcher->frame()->loader()->loadResourceSynchronously(url, AllowStor edCredentials, error, response, data); 651 fetcher->fetchSynchronously(url, AllowStoredCredentials, error, resp onse, data);
652 } 652 }
653 653
654 // We have to check the URL again after the load to catch redirects. 654 // We have to check the URL again after the load to catch redirects.
655 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>. 655 // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
656 if (!shouldAllowExternalLoad(response.url())) 656 if (!shouldAllowExternalLoad(response.url()))
657 return &globalDescriptor; 657 return &globalDescriptor;
658 658
659 return new OffsetBuffer(data); 659 return new OffsetBuffer(data);
660 } 660 }
661 661
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 sax.initialized = XML_SAX2_MAGIC; 1614 sax.initialized = XML_SAX2_MAGIC;
1615 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1615 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1616 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1616 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1617 parseChunk(parser->context(), parseString); 1617 parseChunk(parser->context(), parseString);
1618 finishParsing(parser->context()); 1618 finishParsing(parser->context());
1619 attrsOK = state.gotAttributes; 1619 attrsOK = state.gotAttributes;
1620 return state.attributes; 1620 return state.attributes;
1621 } 1621 }
1622 1622
1623 } // namespace WebCore 1623 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698