summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-03-18 13:16:26 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-20 15:55:39 +0100
commit3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch)
tree92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
parente90d7c4b152c56919d963987e2503f9909a666d2 (diff)
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies needed on Windows. Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42 Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h')
-rw-r--r--chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h49
1 files changed, 23 insertions, 26 deletions
diff --git a/chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
index 1aca7bb3f40..8bbc43e3c64 100644
--- a/chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
+++ b/chromium/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
@@ -29,13 +29,14 @@
#include "bindings/v8/ScriptWrappable.h"
#include "bindings/v8/WorkerScriptController.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
-#include "core/dom/ScriptExecutionContext.h"
-#include "core/page/ContentSecurityPolicy.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventTarget.h"
+#include "core/events/ThreadLocalEventNames.h"
+#include "core/frame/ContentSecurityPolicy.h"
#include "core/workers/WorkerConsole.h"
#include "core/workers/WorkerEventQueue.h"
+#include "core/workers/WorkerSupplementable.h"
#include "wtf/Assertions.h"
#include "wtf/HashMap.h"
#include "wtf/OwnPtr.h"
@@ -57,22 +58,23 @@ namespace WebCore {
class WorkerNavigator;
class WorkerThread;
- class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public ScriptWrappable, public ScriptExecutionContext, public EventTarget {
+ class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public ScriptWrappable, public SecurityContext, public ExecutionContext, public ExecutionContextClient, public WorkerSupplementable, public EventTargetWithInlineData {
+ REFCOUNTED_EVENT_TARGET(WorkerGlobalScope);
public:
virtual ~WorkerGlobalScope();
virtual bool isWorkerGlobalScope() const OVERRIDE { return true; }
- virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
+ virtual ExecutionContext* executionContext() const OVERRIDE;
virtual bool isSharedWorkerGlobalScope() const { return false; }
virtual bool isDedicatedWorkerGlobalScope() const { return false; }
+ virtual bool isServiceWorkerGlobalScope() const { return false; }
const KURL& url() const { return m_url; }
KURL completeURL(const String&) const;
virtual String userAgent(const KURL&) const;
-
virtual void disableEval(const String& errorMessage) OVERRIDE;
WorkerScriptController* script() { return m_script.get(); }
@@ -81,7 +83,7 @@ namespace WebCore {
WorkerThread* thread() const { return m_thread; }
- virtual void postTask(PassOwnPtr<Task>) OVERRIDE; // Executes the task on context's thread asynchronously.
+ virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE; // Executes the task on context's thread asynchronously.
// WorkerGlobalScope
WorkerGlobalScope* self() { return this; }
@@ -95,12 +97,15 @@ namespace WebCore {
virtual void importScripts(const Vector<String>& urls, ExceptionState&);
WorkerNavigator* navigator() const;
- // ScriptExecutionContext
+ // ExecutionContextClient
virtual WorkerEventQueue* eventQueue() const OVERRIDE;
+ virtual SecurityContext& securityContext() OVERRIDE { return *this; }
virtual bool isContextThread() const OVERRIDE;
virtual bool isJSExecutionForbidden() const OVERRIDE;
+ virtual double timerAlignmentInterval() const OVERRIDE;
+
WorkerInspectorController* workerInspectorController() { return m_workerInspectorController.get(); }
// These methods are used for GC marking. See JSWorkerGlobalScope::visitChildrenVirtual(SlotVisitor&) in
// JSWorkerGlobalScopeCustom.cpp.
@@ -108,9 +113,6 @@ namespace WebCore {
WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
WorkerLocation* optionalLocation() const { return m_location.get(); }
- using RefCounted<WorkerGlobalScope>::ref;
- using RefCounted<WorkerGlobalScope>::deref;
-
bool isClosing() { return m_closing; }
// An observer interface to be notified when the worker thread is getting stopped.
@@ -135,6 +137,9 @@ namespace WebCore {
WorkerClients* clients() { return m_workerClients.get(); }
+ using SecurityContext::securityOrigin;
+ using SecurityContext::contentSecurityPolicy;
+
protected:
WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, double timeOrigin, PassOwnPtr<WorkerClients>);
void applyContentSecurityPolicyFromString(const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
@@ -143,20 +148,17 @@ namespace WebCore {
void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallStack>, ScriptState*);
private:
- virtual void refScriptExecutionContext() OVERRIDE { ref(); }
- virtual void derefScriptExecutionContext() OVERRIDE { deref(); }
-
- virtual void refEventTarget() OVERRIDE { ref(); }
- virtual void derefEventTarget() OVERRIDE { deref(); }
- virtual EventTargetData* eventTargetData() OVERRIDE;
- virtual EventTargetData* ensureEventTargetData() OVERRIDE;
+ virtual void refExecutionContext() OVERRIDE { ref(); }
+ virtual void derefExecutionContext() OVERRIDE { deref(); }
virtual const KURL& virtualURL() const OVERRIDE;
virtual KURL virtualCompleteURL(const String&) const;
+ virtual void reportBlockedScriptExecutionToInspector(const String& directiveText) OVERRIDE;
virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, ScriptState* = 0) OVERRIDE;
virtual EventTarget* errorEventTarget() OVERRIDE;
+ virtual void didUpdateSecurityOrigin() OVERRIDE { }
KURL m_url;
String m_userAgent;
@@ -171,7 +173,6 @@ namespace WebCore {
mutable RefPtr<DOMURL> m_domURL;
OwnPtr<WorkerInspectorController> m_workerInspectorController;
bool m_closing;
- EventTargetData m_eventTargetData;
HashSet<Observer*> m_workerObservers;
@@ -182,11 +183,7 @@ namespace WebCore {
double m_timeOrigin;
};
-inline WorkerGlobalScope* toWorkerGlobalScope(ScriptExecutionContext* context)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!context || context->isWorkerGlobalScope());
- return static_cast<WorkerGlobalScope*>(context);
-}
+DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorkerGlobalScope(), context.isWorkerGlobalScope());
} // namespace WebCore