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

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

Issue 288673002: Make ScriptLoader into a ResourceOwner (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/html/parser/HTMLScriptRunner.cpp ('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 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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); 1029 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element);
1030 if (!scriptLoader) { 1030 if (!scriptLoader) {
1031 popCurrentNode(); 1031 popCurrentNode();
1032 return; 1032 return;
1033 } 1033 }
1034 1034
1035 // Don't load external scripts for standalone documents (for now). 1035 // Don't load external scripts for standalone documents (for now).
1036 ASSERT(!m_pendingScript); 1036 ASSERT(!m_pendingScript);
1037 m_requestingScript = true; 1037 m_requestingScript = true;
1038 1038
1039 if (scriptLoader->prepareScript(m_scriptStartPosition, ScriptLoader::AllowLe gacyTypeInTypeAttribute)) { 1039 ScriptPrep prep = scriptLoader->prepareScript(m_scriptStartPosition, ScriptL oader::AllowLegacyTypeInTypeAttribute);
1040 if (prep.succeeded()) {
1040 // FIXME: Script execution should be shared between 1041 // FIXME: Script execution should be shared between
1041 // the libxml2 and Qt XMLDocumentParser implementations. 1042 // the libxml2 and Qt XMLDocumentParser implementations.
1042 1043
1043 if (scriptLoader->readyToBeParserExecuted()) { 1044 if (scriptLoader->readyToBeParserExecuted()) {
1044 scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptCon tent(), document()->url(), m_scriptStartPosition)); 1045 scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptCon tent(), document()->url(), m_scriptStartPosition));
1045 } else if (scriptLoader->willBeParserExecuted()) { 1046 } else if (scriptLoader->willBeParserExecuted()) {
1046 m_pendingScript = scriptLoader->resource(); 1047 m_pendingScript = prep.resource();
1047 m_scriptElement = element; 1048 m_scriptElement = element;
1048 m_pendingScript->addClient(this); 1049 m_pendingScript->addClient(this);
1049 1050
1050 // m_pendingScript will be 0 if script was already loaded and addCli ent() executed it. 1051 // m_pendingScript will be 0 if script was already loaded and addCli ent() executed it.
1051 if (m_pendingScript) 1052 if (m_pendingScript)
1052 pauseParsing(); 1053 pauseParsing();
1053 } else { 1054 } else {
1054 m_scriptElement = nullptr; 1055 m_scriptElement = nullptr;
1055 } 1056 }
1056 1057
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 sax.initialized = XML_SAX2_MAGIC; 1597 sax.initialized = XML_SAX2_MAGIC;
1597 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1598 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1598 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1599 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1599 parseChunk(parser->context(), parseString); 1600 parseChunk(parser->context(), parseString);
1600 finishParsing(parser->context()); 1601 finishParsing(parser->context());
1601 attrsOK = state.gotAttributes; 1602 attrsOK = state.gotAttributes;
1602 return state.attributes; 1603 return state.attributes;
1603 } 1604 }
1604 1605
1605 } // namespace WebCore 1606 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLScriptRunner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698