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 30 matching lines...) Expand all Loading... |
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 } |
50 ~ScriptRunner(); | 50 ~ScriptRunner(); |
| 51 #if !ENABLE(OILPAN) |
| 52 void dispose(); |
| 53 #endif |
51 | 54 |
52 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; | 55 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; |
53 void queueScriptForExecution(ScriptLoader*, ExecutionType); | 56 void queueScriptForExecution(ScriptLoader*, ExecutionType); |
54 bool hasPendingScripts() const { return !m_scriptsToExecuteSoon.isEmpty() ||
!m_scriptsToExecuteInOrder.isEmpty() || !m_pendingAsyncScripts.isEmpty(); } | 57 bool hasPendingScripts() const { return !m_scriptsToExecuteSoon.isEmpty() ||
!m_scriptsToExecuteInOrder.isEmpty() || !m_pendingAsyncScripts.isEmpty(); } |
55 void suspend(); | 58 void suspend(); |
56 void resume(); | 59 void resume(); |
57 void notifyScriptReady(ScriptLoader*, ExecutionType); | 60 void notifyScriptReady(ScriptLoader*, ExecutionType); |
58 void notifyScriptLoadError(ScriptLoader*, ExecutionType); | 61 void notifyScriptLoadError(ScriptLoader*, ExecutionType); |
59 | 62 |
60 static void movePendingAsyncScript(Document&, Document&, ScriptLoader*); | 63 static void movePendingAsyncScript(Document&, Document&, ScriptLoader*); |
(...skipping 14 matching lines...) Expand all Loading... |
75 void postTaskIfOneIsNotAlreadyInFlight(); | 78 void postTaskIfOneIsNotAlreadyInFlight(); |
76 | 79 |
77 RawPtrWillBeMember<Document> m_document; | 80 RawPtrWillBeMember<Document> m_document; |
78 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteInOrder; | 81 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 | 82 // 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; | 83 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_scriptsToExecuteSoon; |
81 WillBeHeapHashSet<RawPtrWillBeMember<ScriptLoader>> m_pendingAsyncScripts; | 84 WillBeHeapHashSet<RawPtrWillBeMember<ScriptLoader>> m_pendingAsyncScripts; |
82 OwnPtr<CancellableTaskFactory> m_executeScriptsTaskFactory; | 85 OwnPtr<CancellableTaskFactory> m_executeScriptsTaskFactory; |
83 }; | 86 }; |
84 | 87 |
85 } | 88 } // namespace blink |
86 | 89 |
87 #endif | 90 #endif // ScriptRunner_h |
OLD | NEW |