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

Side by Side Diff: Source/core/html/parser/HTMLScriptRunner.h

Issue 551293002: Refactor PendingScript / HTMLScriptRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/dom/PendingScript.cpp ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | 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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void executeParsingBlockingScript(); 81 void executeParsingBlockingScript();
82 void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType) ; 82 void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType) ;
83 void executeParsingBlockingScripts(); 83 void executeParsingBlockingScripts();
84 84
85 void requestParsingBlockingScript(Element*); 85 void requestParsingBlockingScript(Element*);
86 void requestDeferredScript(Element*); 86 void requestDeferredScript(Element*);
87 bool requestPendingScript(PendingScript&, Element*) const; 87 bool requestPendingScript(PendingScript&, Element*) const;
88 88
89 void runScript(Element*, const TextPosition& scriptStartPosition); 89 void runScript(Element*, const TextPosition& scriptStartPosition);
90 90
91 // Helpers for dealing with HTMLScriptRunnerHost
92 void watchForLoad(PendingScript&);
93 void stopWatchingForLoad(PendingScript&);
94 bool isPendingScriptReady(const PendingScript&); 91 bool isPendingScriptReady(const PendingScript&);
95 ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOc curred) const;
96 92
97 RawPtrWillBeMember<Document> m_document; 93 RawPtrWillBeMember<Document> m_document;
98 RawPtrWillBeMember<HTMLScriptRunnerHost> m_host; 94 RawPtrWillBeMember<HTMLScriptRunnerHost> m_host;
99 PendingScript m_parserBlockingScript; 95 PendingScript m_parserBlockingScript;
100 Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.or g/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-docume nt-has-finished-parsing 96 Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.or g/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-docume nt-has-finished-parsing
101 unsigned m_scriptNestingLevel; 97 unsigned m_scriptNestingLevel;
102 98
103 // We only want stylesheet loads to trigger script execution if script 99 // We only want stylesheet loads to trigger script execution if script
104 // execution is currently stopped due to stylesheet loads, otherwise we'd 100 // execution is currently stopped due to stylesheet loads, otherwise we'd
105 // cause nested script execution when parsing <style> tags since </style> 101 // cause nested script execution when parsing <style> tags since </style>
106 // tags can cause Document to call executeScriptsWaitingForResources. 102 // tags can cause Document to call executeScriptsWaitingForResources.
107 bool m_hasScriptsWaitingForResources; 103 bool m_hasScriptsWaitingForResources;
108 }; 104 };
109 105
110 } 106 }
111 107
112 #endif 108 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/PendingScript.cpp ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698