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