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 29 matching lines...) Expand all Loading... |
40 class WebTaskRunner; | 40 class WebTaskRunner; |
41 | 41 |
42 class CORE_EXPORT ScriptRunner final : public GarbageCollectedFinalized<ScriptRu
nner> { | 42 class CORE_EXPORT ScriptRunner final : public GarbageCollectedFinalized<ScriptRu
nner> { |
43 WTF_MAKE_NONCOPYABLE(ScriptRunner); | 43 WTF_MAKE_NONCOPYABLE(ScriptRunner); |
44 public: | 44 public: |
45 static ScriptRunner* create(Document* document) | 45 static ScriptRunner* create(Document* document) |
46 { | 46 { |
47 return new ScriptRunner(document); | 47 return new ScriptRunner(document); |
48 } | 48 } |
49 ~ScriptRunner(); | 49 ~ScriptRunner(); |
50 #if !ENABLE(OILPAN) | |
51 void dispose(); | |
52 #endif | |
53 | 50 |
54 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; | 51 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; |
55 void queueScriptForExecution(ScriptLoader*, ExecutionType); | 52 void queueScriptForExecution(ScriptLoader*, ExecutionType); |
56 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() |
| !m_pendingAsyncScripts.isEmpty(); } | 53 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() |
| !m_pendingAsyncScripts.isEmpty(); } |
57 void suspend(); | 54 void suspend(); |
58 void resume(); | 55 void resume(); |
59 void notifyScriptReady(ScriptLoader*, ExecutionType); | 56 void notifyScriptReady(ScriptLoader*, ExecutionType); |
60 void notifyScriptLoadError(ScriptLoader*, ExecutionType); | 57 void notifyScriptLoadError(ScriptLoader*, ExecutionType); |
61 | 58 |
62 static void movePendingScript(Document&, Document&, ScriptLoader*); | 59 static void movePendingScript(Document&, Document&, ScriptLoader*); |
(...skipping 25 matching lines...) Expand all Loading... |
88 HeapDeque<Member<ScriptLoader>> m_inOrderScriptsToExecuteSoon; | 85 HeapDeque<Member<ScriptLoader>> m_inOrderScriptsToExecuteSoon; |
89 | 86 |
90 WebTaskRunner* m_taskRunner; | 87 WebTaskRunner* m_taskRunner; |
91 | 88 |
92 int m_numberOfInOrderScriptsWithPendingNotification; | 89 int m_numberOfInOrderScriptsWithPendingNotification; |
93 | 90 |
94 bool m_isSuspended; | 91 bool m_isSuspended; |
95 #ifndef NDEBUG | 92 #ifndef NDEBUG |
96 bool m_hasEverBeenSuspended; | 93 bool m_hasEverBeenSuspended; |
97 #endif | 94 #endif |
98 | |
99 #if !ENABLE(OILPAN) | |
100 bool m_isDisposed; | |
101 WeakPtrFactory<ScriptRunner> m_weakPointerFactoryForTasks; | |
102 #endif | |
103 }; | 95 }; |
104 | 96 |
105 } // namespace blink | 97 } // namespace blink |
106 | 98 |
107 #endif // ScriptRunner_h | 99 #endif // ScriptRunner_h |
OLD | NEW |