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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) {} | 68 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) {} |
69 virtual void didEvaluateWorkerScript() {} | 69 virtual void didEvaluateWorkerScript() {} |
70 virtual void countFeature(UseCounter::Feature) const; | 70 virtual void countFeature(UseCounter::Feature) const; |
71 virtual void countDeprecation(UseCounter::Feature) const; | 71 virtual void countDeprecation(UseCounter::Feature) const; |
72 | 72 |
73 // Returns null if caching is not supported. | 73 // Returns null if caching is not supported. |
74 virtual CachedMetadataHandler* createWorkerScriptCachedMetadataHandler(const
KURL& scriptURL, const Vector<char>* metaData) { return nullptr; } | 74 virtual CachedMetadataHandler* createWorkerScriptCachedMetadataHandler(const
KURL& scriptURL, const Vector<char>* metaData) { return nullptr; } |
75 | 75 |
76 KURL completeURL(const String&) const; | 76 KURL completeURL(const String&) const; |
77 void dispose(); | 77 void dispose() final; |
78 void exceptionUnhandled(const String& errorMessage, std::unique_ptr<SourceLo
cation>); | 78 void exceptionUnhandled(const String& errorMessage, std::unique_ptr<SourceLo
cation>); |
79 | 79 |
80 void registerEventListener(V8AbstractEventListener*); | 80 void registerEventListener(V8AbstractEventListener*); |
81 void deregisterEventListener(V8AbstractEventListener*); | 81 void deregisterEventListener(V8AbstractEventListener*); |
82 | 82 |
83 // WorkerGlobalScope | 83 // WorkerGlobalScope |
84 WorkerGlobalScope* self() { return this; } | 84 WorkerGlobalScope* self() { return this; } |
85 WorkerLocation* location() const; | 85 WorkerLocation* location() const; |
86 WorkerNavigator* navigator() const; | 86 WorkerNavigator* navigator() const; |
87 void close(); | 87 void close(); |
(...skipping 28 matching lines...) Expand all Loading... |
116 // WorkerOrWorkletGlobalScope | 116 // WorkerOrWorkletGlobalScope |
117 ScriptWrappable* getScriptWrappable() const final | 117 ScriptWrappable* getScriptWrappable() const final |
118 { | 118 { |
119 return const_cast<WorkerGlobalScope*>(this); | 119 return const_cast<WorkerGlobalScope*>(this); |
120 } | 120 } |
121 | 121 |
122 // Returns true when the WorkerGlobalScope is closing (e.g. via close() | 122 // Returns true when the WorkerGlobalScope is closing (e.g. via close() |
123 // method). If this returns true, the worker is going to be shutdown after | 123 // method). If this returns true, the worker is going to be shutdown after |
124 // the current task execution. Workers that don't support close operation | 124 // the current task execution. Workers that don't support close operation |
125 // should always return false. | 125 // should always return false. |
126 bool isClosing() const { return m_closing; } | 126 bool isClosing() const final { return m_closing; } |
127 | 127 |
128 const KURL& url() const { return m_url; } | 128 const KURL& url() const { return m_url; } |
129 WorkerThread* thread() const { return m_thread; } | 129 WorkerThread* thread() const { return m_thread; } |
130 double timeOrigin() const { return m_timeOrigin; } | 130 double timeOrigin() const { return m_timeOrigin; } |
131 | 131 |
132 WorkerOrWorkletScriptController* scriptController() final { return m_scriptC
ontroller.get(); } | 132 WorkerOrWorkletScriptController* scriptController() final { return m_scriptC
ontroller.get(); } |
133 WorkerInspectorController* workerInspectorController() { return m_workerInsp
ectorController.get(); } | 133 WorkerInspectorController* workerInspectorController() { return m_workerInsp
ectorController.get(); } |
134 WorkerClients* clients() { return m_workerClients.get(); } | 134 WorkerClients* clients() { return m_workerClients.get(); } |
135 ConsoleMessageStorage* consoleMessageStorage() { return m_consoleMessageStor
age.get(); } | 135 ConsoleMessageStorage* consoleMessageStorage() { return m_consoleMessageStor
age.get(); } |
136 | 136 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 Member<ConsoleMessageStorage> m_consoleMessageStorage; | 185 Member<ConsoleMessageStorage> m_consoleMessageStorage; |
186 | 186 |
187 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners; | 187 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners; |
188 }; | 188 }; |
189 | 189 |
190 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); | 190 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); |
191 | 191 |
192 } // namespace blink | 192 } // namespace blink |
193 | 193 |
194 #endif // WorkerGlobalScope_h | 194 #endif // WorkerGlobalScope_h |
OLD | NEW |