| 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 16 matching lines...) Expand all Loading... |
| 27 #ifndef WorkerGlobalScope_h | 27 #ifndef WorkerGlobalScope_h |
| 28 #define WorkerGlobalScope_h | 28 #define WorkerGlobalScope_h |
| 29 | 29 |
| 30 #include "bindings/core/v8/WorkerScriptController.h" | 30 #include "bindings/core/v8/WorkerScriptController.h" |
| 31 #include "core/dom/ExecutionContext.h" | 31 #include "core/dom/ExecutionContext.h" |
| 32 #include "core/events/EventListener.h" | 32 #include "core/events/EventListener.h" |
| 33 #include "core/events/EventTarget.h" | 33 #include "core/events/EventTarget.h" |
| 34 #include "core/frame/DOMWindowBase64.h" | 34 #include "core/frame/DOMWindowBase64.h" |
| 35 #include "core/frame/UseCounter.h" | 35 #include "core/frame/UseCounter.h" |
| 36 #include "core/frame/csp/ContentSecurityPolicy.h" | 36 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 37 #include "core/inspector/ConsoleMessage.h" |
| 37 #include "core/workers/WorkerEventQueue.h" | 38 #include "core/workers/WorkerEventQueue.h" |
| 38 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
| 39 #include "platform/network/ContentSecurityPolicyParsers.h" | 40 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 40 #include "wtf/Assertions.h" | 41 #include "wtf/Assertions.h" |
| 41 #include "wtf/HashMap.h" | 42 #include "wtf/HashMap.h" |
| 42 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 43 #include "wtf/PassRefPtr.h" | 44 #include "wtf/PassRefPtr.h" |
| 44 #include "wtf/RefCounted.h" | 45 #include "wtf/RefCounted.h" |
| 45 #include "wtf/RefPtr.h" | 46 #include "wtf/RefPtr.h" |
| 46 #include "wtf/text/AtomicStringHash.h" | 47 #include "wtf/text/AtomicStringHash.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 using SecurityContext::securityOrigin; | 137 using SecurityContext::securityOrigin; |
| 137 using SecurityContext::contentSecurityPolicy; | 138 using SecurityContext::contentSecurityPolicy; |
| 138 | 139 |
| 139 virtual void trace(Visitor*) OVERRIDE; | 140 virtual void trace(Visitor*) OVERRIDE; |
| 140 | 141 |
| 141 protected: | 142 protected: |
| 142 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d
ouble timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); | 143 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d
ouble timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>); |
| 143 void applyContentSecurityPolicyFromString(const String& contentSecurityP
olicy, ContentSecurityPolicyHeaderType); | 144 void applyContentSecurityPolicyFromString(const String& contentSecurityP
olicy, ContentSecurityPolicyHeaderType); |
| 144 | 145 |
| 145 virtual void logExceptionToConsole(const String& errorMessage, const Str
ing& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptC
allStack>) OVERRIDE; | 146 virtual void logExceptionToConsole(const String& errorMessage, const Str
ing& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptC
allStack>) OVERRIDE; |
| 146 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String
& message, const String& sourceURL, unsigned lineNumber, PassRefPtrWillBeRawPtr<
ScriptCallStack>, ScriptState*); | 147 void addMessageToWorkerConsole(PassRefPtr<ConsoleMessage>); |
| 147 | 148 |
| 148 private: | 149 private: |
| 149 #if !ENABLE(OILPAN) | 150 #if !ENABLE(OILPAN) |
| 150 virtual void refExecutionContext() OVERRIDE FINAL { ref(); } | 151 virtual void refExecutionContext() OVERRIDE FINAL { ref(); } |
| 151 virtual void derefExecutionContext() OVERRIDE FINAL { deref(); } | 152 virtual void derefExecutionContext() OVERRIDE FINAL { deref(); } |
| 152 #endif | 153 #endif |
| 153 | 154 |
| 154 virtual const KURL& virtualURL() const OVERRIDE FINAL; | 155 virtual const KURL& virtualURL() const OVERRIDE FINAL; |
| 155 virtual KURL virtualCompleteURL(const String&) const OVERRIDE FINAL; | 156 virtual KURL virtualCompleteURL(const String&) const OVERRIDE FINAL; |
| 156 | 157 |
| 157 virtual void reportBlockedScriptExecutionToInspector(const String& direc
tiveText) OVERRIDE FINAL; | 158 virtual void reportBlockedScriptExecutionToInspector(const String& direc
tiveText) OVERRIDE FINAL; |
| 158 virtual void addMessage(MessageSource, MessageLevel, const String& messa
ge, const String& sourceURL, unsigned lineNumber, ScriptState* = 0) OVERRIDE FIN
AL; | 159 virtual void addMessage(PassRefPtr<ConsoleMessage>) OVERRIDE FINAL; |
| 159 | 160 |
| 160 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; | 161 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; |
| 161 virtual void didUpdateSecurityOrigin() OVERRIDE FINAL { } | 162 virtual void didUpdateSecurityOrigin() OVERRIDE FINAL { } |
| 162 | 163 |
| 163 KURL m_url; | 164 KURL m_url; |
| 164 String m_userAgent; | 165 String m_userAgent; |
| 165 | 166 |
| 166 mutable RefPtrWillBeMember<WorkerConsole> m_console; | 167 mutable RefPtrWillBeMember<WorkerConsole> m_console; |
| 167 mutable RefPtrWillBeMember<WorkerLocation> m_location; | 168 mutable RefPtrWillBeMember<WorkerLocation> m_location; |
| 168 mutable RefPtrWillBeMember<WorkerNavigator> m_navigator; | 169 mutable RefPtrWillBeMember<WorkerNavigator> m_navigator; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 179 | 180 |
| 180 double m_timeOrigin; | 181 double m_timeOrigin; |
| 181 TerminationObserver* m_terminationObserver; | 182 TerminationObserver* m_terminationObserver; |
| 182 }; | 183 }; |
| 183 | 184 |
| 184 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); | 185 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke
rGlobalScope(), context.isWorkerGlobalScope()); |
| 185 | 186 |
| 186 } // namespace blink | 187 } // namespace blink |
| 187 | 188 |
| 188 #endif // WorkerGlobalScope_h | 189 #endif // WorkerGlobalScope_h |
| OLD | NEW |