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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2658213004: [TEST] Forbid reentering ScriptLoader::prepareScript()
Patch Set: more DCHECK Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 bool ScriptLoader::isScriptTypeSupported( 195 bool ScriptLoader::isScriptTypeSupported(
196 LegacyTypeSupport supportLegacyTypes) const { 196 LegacyTypeSupport supportLegacyTypes) const {
197 return isValidScriptTypeAndLanguage(client()->typeAttributeValue(), 197 return isValidScriptTypeAndLanguage(client()->typeAttributeValue(),
198 client()->languageAttributeValue(), 198 client()->languageAttributeValue(),
199 supportLegacyTypes); 199 supportLegacyTypes);
200 } 200 }
201 201
202 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script 202 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script
203 bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, 203 bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition,
204 LegacyTypeSupport supportLegacyTypes) { 204 LegacyTypeSupport supportLegacyTypes) {
205 DCHECK(!m_inPrepareScript);
206 AutoReset<bool> inPrepareScriptScope(&m_inPrepareScript, true);
207
208 DCHECK(!m_willBeParserExecuted);
209 DCHECK(!m_willExecuteWhenDocumentFinishedParsing);
210 DCHECK(!m_readyToBeParserExecuted);
211
205 if (m_alreadyStarted) 212 if (m_alreadyStarted)
206 return false; 213 return false;
207 214
208 ScriptLoaderClient* client = this->client(); 215 ScriptLoaderClient* client = this->client();
209 216
210 bool wasParserInserted; 217 bool wasParserInserted;
211 if (m_parserInserted) { 218 if (m_parserInserted) {
212 wasParserInserted = true; 219 wasParserInserted = true;
213 m_parserInserted = false; 220 m_parserInserted = false;
214 } else { 221 } else {
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 if (isHTMLScriptLoader(element)) 651 if (isHTMLScriptLoader(element))
645 return toHTMLScriptElement(element)->loader(); 652 return toHTMLScriptElement(element)->loader();
646 653
647 if (isSVGScriptLoader(element)) 654 if (isSVGScriptLoader(element))
648 return toSVGScriptElement(element)->loader(); 655 return toSVGScriptElement(element)->loader();
649 656
650 return 0; 657 return 0;
651 } 658 }
652 659
653 } // namespace blink 660 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698