| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class Resource; | 38 class Resource; |
| 39 class ScriptResource; | 39 class ScriptResource; |
| 40 class Document; | 40 class Document; |
| 41 class Element; | 41 class Element; |
| 42 class LocalFrame; | 42 class LocalFrame; |
| 43 class HTMLScriptRunnerHost; | 43 class HTMLScriptRunnerHost; |
| 44 class ScriptSourceCode; | 44 class ScriptSourceCode; |
| 45 | 45 |
| 46 class HTMLScriptRunner FINAL : public NoBaseWillBeGarbageCollectedFinalized<HTML
ScriptRunner>, private ResourceClient { | 46 class HTMLScriptRunner FINAL : public NoBaseWillBeGarbageCollectedFinalized<HTML
ScriptRunner>, private ScriptResourceClient { |
| 47 WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMO
VED; | 47 WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMO
VED; |
| 48 public: | 48 public: |
| 49 static PassOwnPtrWillBeRawPtr<HTMLScriptRunner> create(Document* document, H
TMLScriptRunnerHost* host) | 49 static PassOwnPtrWillBeRawPtr<HTMLScriptRunner> create(Document* document, H
TMLScriptRunnerHost* host) |
| 50 { | 50 { |
| 51 return adoptPtrWillBeNoop(new HTMLScriptRunner(document, host)); | 51 return adoptPtrWillBeNoop(new HTMLScriptRunner(document, host)); |
| 52 } | 52 } |
| 53 ~HTMLScriptRunner(); | 53 ~HTMLScriptRunner(); |
| 54 | 54 |
| 55 void detach(); | 55 void detach(); |
| 56 | 56 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 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 | 91 // Helpers for dealing with HTMLScriptRunnerHost |
| 92 void watchForLoad(PendingScript&); | 92 void watchForLoad(PendingScript&); |
| 93 void stopWatchingForLoad(PendingScript&); | 93 void stopWatchingForLoad(PendingScript&); |
| 94 bool isPendingScriptReady(const PendingScript&); | 94 bool isPendingScriptReady(const PendingScript&); |
| 95 ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOc
curred) const; | 95 ScriptSourceCode sourceFromPendingScript(PendingScript&, bool& errorOccurred
) const; |
| 96 | 96 |
| 97 RawPtrWillBeMember<Document> m_document; | 97 RawPtrWillBeMember<Document> m_document; |
| 98 RawPtrWillBeMember<HTMLScriptRunnerHost> m_host; | 98 RawPtrWillBeMember<HTMLScriptRunnerHost> m_host; |
| 99 PendingScript m_parserBlockingScript; | 99 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 | 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 |
| 101 unsigned m_scriptNestingLevel; | 101 unsigned m_scriptNestingLevel; |
| 102 | 102 |
| 103 // We only want stylesheet loads to trigger script execution if script | 103 // We only want stylesheet loads to trigger script execution if script |
| 104 // execution is currently stopped due to stylesheet loads, otherwise we'd | 104 // execution is currently stopped due to stylesheet loads, otherwise we'd |
| 105 // cause nested script execution when parsing <style> tags since </style> | 105 // cause nested script execution when parsing <style> tags since </style> |
| 106 // tags can cause Document to call executeScriptsWaitingForResources. | 106 // tags can cause Document to call executeScriptsWaitingForResources. |
| 107 bool m_hasScriptsWaitingForResources; | 107 bool m_hasScriptsWaitingForResources; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } | 110 } |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |