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 WebTaskRunner; | 41 class WebTaskRunner; |
42 | 42 |
43 class CORE_EXPORT ScriptRunner final : public GarbageCollected<ScriptRunner> { | 43 class CORE_EXPORT ScriptRunner final : public GarbageCollected<ScriptRunner> { |
44 WTF_MAKE_NONCOPYABLE(ScriptRunner); | 44 WTF_MAKE_NONCOPYABLE(ScriptRunner); |
45 public: | 45 public: |
46 static ScriptRunner* create(Document* document) | 46 static ScriptRunner* create(Document* document) |
47 { | 47 { |
48 return new ScriptRunner(document); | 48 return new ScriptRunner(document); |
49 } | 49 } |
50 | 50 |
51 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; | 51 enum AsyncExecutionType { NoExecType, AsyncExecution, InOrderExecution }; |
kouhei (in TOK)
2016/08/29 00:20:49
Optional: enum class is preferred over enum.
enum
| |
52 void queueScriptForExecution(ScriptLoader*, ExecutionType); | 52 void queueScriptForExecution(ScriptLoader*, AsyncExecutionType); |
53 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() | | !m_pendingAsyncScripts.isEmpty(); } | 53 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() | | !m_pendingAsyncScripts.isEmpty(); } |
54 void suspend(); | 54 void suspend(); |
55 void resume(); | 55 void resume(); |
56 void notifyScriptReady(ScriptLoader*, ExecutionType); | 56 void notifyScriptReady(ScriptLoader*, AsyncExecutionType); |
57 void notifyScriptLoadError(ScriptLoader*, ExecutionType); | 57 void notifyScriptLoadError(ScriptLoader*, AsyncExecutionType); |
58 | 58 |
59 static void movePendingScript(Document&, Document&, ScriptLoader*); | 59 static void movePendingScript(Document&, Document&, ScriptLoader*); |
60 | 60 |
61 DECLARE_TRACE(); | 61 DECLARE_TRACE(); |
62 | 62 |
63 private: | 63 private: |
64 class Task; | 64 class Task; |
65 | 65 |
66 explicit ScriptRunner(Document*); | 66 explicit ScriptRunner(Document*); |
67 | 67 |
(...skipping 22 matching lines...) Expand all Loading... | |
90 | 90 |
91 bool m_isSuspended; | 91 bool m_isSuspended; |
92 #ifndef NDEBUG | 92 #ifndef NDEBUG |
93 bool m_hasEverBeenSuspended; | 93 bool m_hasEverBeenSuspended; |
94 #endif | 94 #endif |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // ScriptRunner_h | 99 #endif // ScriptRunner_h |
OLD | NEW |