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 21 matching lines...) Expand all Loading... |
32 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
33 #include "wtf/Noncopyable.h" | 33 #include "wtf/Noncopyable.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class CancellableTaskFactory; | 37 class CancellableTaskFactory; |
38 class Document; | 38 class Document; |
39 class ScriptLoader; | 39 class ScriptLoader; |
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 GarbageCollected<ScriptRunner> { |
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(); | |
50 | 49 |
51 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; | 50 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; |
52 void queueScriptForExecution(ScriptLoader*, ExecutionType); | 51 void queueScriptForExecution(ScriptLoader*, ExecutionType); |
53 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() |
| !m_pendingAsyncScripts.isEmpty(); } | 52 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() |
| !m_pendingAsyncScripts.isEmpty(); } |
54 void suspend(); | 53 void suspend(); |
55 void resume(); | 54 void resume(); |
56 void notifyScriptReady(ScriptLoader*, ExecutionType); | 55 void notifyScriptReady(ScriptLoader*, ExecutionType); |
57 void notifyScriptLoadError(ScriptLoader*, ExecutionType); | 56 void notifyScriptLoadError(ScriptLoader*, ExecutionType); |
58 | 57 |
59 static void movePendingScript(Document&, Document&, ScriptLoader*); | 58 static void movePendingScript(Document&, Document&, ScriptLoader*); |
(...skipping 30 matching lines...) Expand all Loading... |
90 | 89 |
91 bool m_isSuspended; | 90 bool m_isSuspended; |
92 #ifndef NDEBUG | 91 #ifndef NDEBUG |
93 bool m_hasEverBeenSuspended; | 92 bool m_hasEverBeenSuspended; |
94 #endif | 93 #endif |
95 }; | 94 }; |
96 | 95 |
97 } // namespace blink | 96 } // namespace blink |
98 | 97 |
99 #endif // ScriptRunner_h | 98 #endif // ScriptRunner_h |
OLD | NEW |