OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "wtf/RefPtr.h" | 50 #include "wtf/RefPtr.h" |
51 #include "wtf/text/AtomicStringHash.h" | 51 #include "wtf/text/AtomicStringHash.h" |
52 | 52 |
53 namespace blink { | 53 namespace blink { |
54 | 54 |
55 class ConsoleMessage; | 55 class ConsoleMessage; |
56 class ConsoleMessageStorage; | 56 class ConsoleMessageStorage; |
57 class ExceptionState; | 57 class ExceptionState; |
58 class V8AbstractEventListener; | 58 class V8AbstractEventListener; |
59 class WorkerClients; | 59 class WorkerClients; |
60 class WorkerConsole; | |
61 class WorkerInspectorController; | 60 class WorkerInspectorController; |
62 class WorkerLocation; | 61 class WorkerLocation; |
63 class WorkerNavigator; | 62 class WorkerNavigator; |
64 class WorkerThread; | 63 class WorkerThread; |
65 | 64 |
66 class CORE_EXPORT WorkerGlobalScope : public EventTargetWithInlineData, public S
ecurityContext, public WorkerOrWorkletGlobalScope, public Supplementable<WorkerG
lobalScope>, public DOMWindowBase64 { | 65 class CORE_EXPORT WorkerGlobalScope : public EventTargetWithInlineData, public S
ecurityContext, public WorkerOrWorkletGlobalScope, public Supplementable<WorkerG
lobalScope>, public DOMWindowBase64 { |
67 DEFINE_WRAPPERTYPEINFO(); | 66 DEFINE_WRAPPERTYPEINFO(); |
68 USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScope); | 67 USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScope); |
69 public: | 68 public: |
70 ~WorkerGlobalScope() override; | 69 ~WorkerGlobalScope() override; |
(...skipping 19 matching lines...) Expand all Loading... |
90 | 89 |
91 virtual void didEvaluateWorkerScript(); | 90 virtual void didEvaluateWorkerScript(); |
92 void dispose(); | 91 void dispose(); |
93 | 92 |
94 WorkerThread* thread() const { return m_thread; } | 93 WorkerThread* thread() const { return m_thread; } |
95 | 94 |
96 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>) fin
al; // Executes the task on context's thread asynchronously. | 95 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>) fin
al; // Executes the task on context's thread asynchronously. |
97 | 96 |
98 // WorkerGlobalScope | 97 // WorkerGlobalScope |
99 WorkerGlobalScope* self() { return this; } | 98 WorkerGlobalScope* self() { return this; } |
100 WorkerConsole* console(); | |
101 WorkerLocation* location() const; | 99 WorkerLocation* location() const; |
102 void close(); | 100 void close(); |
103 | 101 |
104 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
105 DEFINE_ATTRIBUTE_EVENT_LISTENER(rejectionhandled); | 103 DEFINE_ATTRIBUTE_EVENT_LISTENER(rejectionhandled); |
106 DEFINE_ATTRIBUTE_EVENT_LISTENER(unhandledrejection); | 104 DEFINE_ATTRIBUTE_EVENT_LISTENER(unhandledrejection); |
107 | 105 |
108 // WorkerUtils | 106 // WorkerUtils |
109 virtual void importScripts(const Vector<String>& urls, ExceptionState&); | 107 virtual void importScripts(const Vector<String>& urls, ExceptionState&); |
110 // Returns null if caching is not supported. | 108 // Returns null if caching is not supported. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 169 |
172 void clearScript(); | 170 void clearScript(); |
173 void clearInspector(); | 171 void clearInspector(); |
174 | 172 |
175 static void removeURLFromMemoryCacheInternal(const KURL&); | 173 static void removeURLFromMemoryCacheInternal(const KURL&); |
176 | 174 |
177 KURL m_url; | 175 KURL m_url; |
178 String m_userAgent; | 176 String m_userAgent; |
179 V8CacheOptions m_v8CacheOptions; | 177 V8CacheOptions m_v8CacheOptions; |
180 | 178 |
181 mutable Member<WorkerConsole> m_console; | |
182 mutable Member<WorkerLocation> m_location; | 179 mutable Member<WorkerLocation> m_location; |
183 mutable Member<WorkerNavigator> m_navigator; | 180 mutable Member<WorkerNavigator> m_navigator; |
184 | 181 |
185 mutable UseCounter::CountBits m_deprecationWarningBits; | 182 mutable UseCounter::CountBits m_deprecationWarningBits; |
186 | 183 |
187 Member<WorkerOrWorkletScriptController> m_scriptController; | 184 Member<WorkerOrWorkletScriptController> m_scriptController; |
188 WorkerThread* m_thread; | 185 WorkerThread* m_thread; |
189 | 186 |
190 Member<WorkerInspectorController> m_workerInspectorController; | 187 Member<WorkerInspectorController> m_workerInspectorController; |
191 bool m_closing; | 188 bool m_closing; |
(...skipping 11 matching lines...) Expand all Loading... |
203 unsigned long m_workerExceptionUniqueIdentifier; | 200 unsigned long m_workerExceptionUniqueIdentifier; |
204 HeapHashMap<unsigned long, Member<ConsoleMessage>> m_pendingMessages; | 201 HeapHashMap<unsigned long, Member<ConsoleMessage>> m_pendingMessages; |
205 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners; | 202 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners; |
206 }; | 203 }; |
207 | 204 |
208 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); | 205 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); |
209 | 206 |
210 } // namespace blink | 207 } // namespace blink |
211 | 208 |
212 #endif // WorkerGlobalScope_h | 209 #endif // WorkerGlobalScope_h |
OLD | NEW |