| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class DOMURL; | 51 class DOMURL; |
| 52 class ExceptionState; | 52 class ExceptionState; |
| 53 class ScheduledAction; | 53 class ScheduledAction; |
| 54 class WorkerClients; | 54 class WorkerClients; |
| 55 class WorkerConsole; | 55 class WorkerConsole; |
| 56 class WorkerInspectorController; | 56 class WorkerInspectorController; |
| 57 class WorkerLocation; | 57 class WorkerLocation; |
| 58 class WorkerNavigator; | 58 class WorkerNavigator; |
| 59 class WorkerThread; | 59 class WorkerThread; |
| 60 | 60 |
| 61 class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public Scrip
tWrappable, public ScriptExecutionContext, public WorkerSupplementable, public E
ventTarget { | 61 class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public Scrip
tWrappable, public ScriptExecutionContext, public WorkerSupplementable, public E
ventTargetWithInlineData { |
| 62 public: | 62 public: |
| 63 virtual ~WorkerGlobalScope(); | 63 virtual ~WorkerGlobalScope(); |
| 64 | 64 |
| 65 virtual bool isWorkerGlobalScope() const OVERRIDE { return true; } | 65 virtual bool isWorkerGlobalScope() const OVERRIDE { return true; } |
| 66 | 66 |
| 67 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; | 67 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; |
| 68 | 68 |
| 69 virtual bool isSharedWorkerGlobalScope() const { return false; } | 69 virtual bool isSharedWorkerGlobalScope() const { return false; } |
| 70 virtual bool isDedicatedWorkerGlobalScope() const { return false; } | 70 virtual bool isDedicatedWorkerGlobalScope() const { return false; } |
| 71 | 71 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 virtual void logExceptionToConsole(const String& errorMessage, const Str
ing& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) O
VERRIDE; | 143 virtual void logExceptionToConsole(const String& errorMessage, const Str
ing& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) O
VERRIDE; |
| 144 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String
& message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt
ack>, ScriptState*); | 144 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String
& message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt
ack>, ScriptState*); |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 virtual void refScriptExecutionContext() OVERRIDE { ref(); } | 147 virtual void refScriptExecutionContext() OVERRIDE { ref(); } |
| 148 virtual void derefScriptExecutionContext() OVERRIDE { deref(); } | 148 virtual void derefScriptExecutionContext() OVERRIDE { deref(); } |
| 149 | 149 |
| 150 virtual void refEventTarget() OVERRIDE { ref(); } | 150 virtual void refEventTarget() OVERRIDE { ref(); } |
| 151 virtual void derefEventTarget() OVERRIDE { deref(); } | 151 virtual void derefEventTarget() OVERRIDE { deref(); } |
| 152 virtual EventTargetData* eventTargetData() OVERRIDE; | |
| 153 virtual EventTargetData* ensureEventTargetData() OVERRIDE; | |
| 154 | 152 |
| 155 virtual const KURL& virtualURL() const OVERRIDE; | 153 virtual const KURL& virtualURL() const OVERRIDE; |
| 156 virtual KURL virtualCompleteURL(const String&) const; | 154 virtual KURL virtualCompleteURL(const String&) const; |
| 157 | 155 |
| 158 virtual void addMessage(MessageSource, MessageLevel, const String& messa
ge, const String& sourceURL, unsigned lineNumber, ScriptState* = 0) OVERRIDE; | 156 virtual void addMessage(MessageSource, MessageLevel, const String& messa
ge, const String& sourceURL, unsigned lineNumber, ScriptState* = 0) OVERRIDE; |
| 159 | 157 |
| 160 virtual EventTarget* errorEventTarget() OVERRIDE; | 158 virtual EventTarget* errorEventTarget() OVERRIDE; |
| 161 | 159 |
| 162 KURL m_url; | 160 KURL m_url; |
| 163 String m_userAgent; | 161 String m_userAgent; |
| 164 | 162 |
| 165 mutable RefPtr<WorkerConsole> m_console; | 163 mutable RefPtr<WorkerConsole> m_console; |
| 166 mutable RefPtr<WorkerLocation> m_location; | 164 mutable RefPtr<WorkerLocation> m_location; |
| 167 mutable RefPtr<WorkerNavigator> m_navigator; | 165 mutable RefPtr<WorkerNavigator> m_navigator; |
| 168 | 166 |
| 169 OwnPtr<WorkerScriptController> m_script; | 167 OwnPtr<WorkerScriptController> m_script; |
| 170 WorkerThread* m_thread; | 168 WorkerThread* m_thread; |
| 171 | 169 |
| 172 mutable RefPtr<DOMURL> m_domURL; | 170 mutable RefPtr<DOMURL> m_domURL; |
| 173 OwnPtr<WorkerInspectorController> m_workerInspectorController; | 171 OwnPtr<WorkerInspectorController> m_workerInspectorController; |
| 174 bool m_closing; | 172 bool m_closing; |
| 175 EventTargetData m_eventTargetData; | |
| 176 | 173 |
| 177 HashSet<Observer*> m_workerObservers; | 174 HashSet<Observer*> m_workerObservers; |
| 178 | 175 |
| 179 OwnPtr<WorkerEventQueue> m_eventQueue; | 176 OwnPtr<WorkerEventQueue> m_eventQueue; |
| 180 | 177 |
| 181 OwnPtr<WorkerClients> m_workerClients; | 178 OwnPtr<WorkerClients> m_workerClients; |
| 182 | 179 |
| 183 double m_timeOrigin; | 180 double m_timeOrigin; |
| 184 }; | 181 }; |
| 185 | 182 |
| 186 inline WorkerGlobalScope* toWorkerGlobalScope(ScriptExecutionContext* context) | 183 inline WorkerGlobalScope* toWorkerGlobalScope(ScriptExecutionContext* context) |
| 187 { | 184 { |
| 188 ASSERT_WITH_SECURITY_IMPLICATION(!context || context->isWorkerGlobalScope())
; | 185 ASSERT_WITH_SECURITY_IMPLICATION(!context || context->isWorkerGlobalScope())
; |
| 189 return static_cast<WorkerGlobalScope*>(context); | 186 return static_cast<WorkerGlobalScope*>(context); |
| 190 } | 187 } |
| 191 | 188 |
| 192 } // namespace WebCore | 189 } // namespace WebCore |
| 193 | 190 |
| 194 #endif // WorkerGlobalScope_h | 191 #endif // WorkerGlobalScope_h |
| OLD | NEW |