| 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef ScriptRunner_h | 26 #ifndef ScriptRunner_h |
| 27 #define ScriptRunner_h | 27 #define ScriptRunner_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/fetch/ResourcePtr.h" | 30 #include "core/fetch/ResourcePtr.h" |
| 31 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
| 32 #include "platform/scheduler/CancellableTaskFactory.h" | |
| 33 #include "wtf/Deque.h" | 32 #include "wtf/Deque.h" |
| 34 #include "wtf/HashMap.h" | 33 #include "wtf/HashMap.h" |
| 35 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 36 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 39 class CancellableTaskFactory; |
| 40 class Document; | 40 class Document; |
| 41 class ScriptLoader; | 41 class ScriptLoader; |
| 42 | 42 |
| 43 class CORE_EXPORT ScriptRunner final : public NoBaseWillBeGarbageCollectedFinali
zed<ScriptRunner> { | 43 class CORE_EXPORT ScriptRunner final : public NoBaseWillBeGarbageCollectedFinali
zed<ScriptRunner> { |
| 44 WTF_MAKE_NONCOPYABLE(ScriptRunner); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(
ScriptRunner); | 44 WTF_MAKE_NONCOPYABLE(ScriptRunner); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(
ScriptRunner); |
| 45 public: | 45 public: |
| 46 static PassOwnPtrWillBeRawPtr<ScriptRunner> create(Document* document) | 46 static PassOwnPtrWillBeRawPtr<ScriptRunner> create(Document* document) |
| 47 { | 47 { |
| 48 return adoptPtrWillBeNoop(new ScriptRunner(document)); | 48 return adoptPtrWillBeNoop(new ScriptRunner(document)); |
| 49 } | 49 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 bool yieldForHighPriorityWork(); | 73 bool yieldForHighPriorityWork(); |
| 74 | 74 |
| 75 void postTaskIfOneIsNotAlreadyInFlight(); | 75 void postTaskIfOneIsNotAlreadyInFlight(); |
| 76 | 76 |
| 77 RawPtrWillBeMember<Document> m_document; | 77 RawPtrWillBeMember<Document> m_document; |
| 78 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteInOrder; | 78 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteInOrder; |
| 79 // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-wi
ll-execute-as-soon-as-possible | 79 // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-wi
ll-execute-as-soon-as-possible |
| 80 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteSoon; | 80 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteSoon; |
| 81 WillBeHeapHashSet<RawPtrWillBeMember<ScriptLoader>> m_pendingAsyncScripts; | 81 WillBeHeapHashSet<RawPtrWillBeMember<ScriptLoader>> m_pendingAsyncScripts; |
| 82 CancellableTaskFactory m_executeScriptsTaskFactory; | 82 OwnPtr<CancellableTaskFactory> m_executeScriptsTaskFactory; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } | 85 } |
| 86 | 86 |
| 87 #endif | 87 #endif |
| OLD | NEW |