diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/workers/DedicatedWorkerGlobalScope.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/workers/DedicatedWorkerGlobalScope.h')
-rw-r--r-- | Source/WebCore/workers/DedicatedWorkerGlobalScope.h | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/Source/WebCore/workers/DedicatedWorkerGlobalScope.h b/Source/WebCore/workers/DedicatedWorkerGlobalScope.h index 52762c1b9..c86e8de1e 100644 --- a/Source/WebCore/workers/DedicatedWorkerGlobalScope.h +++ b/Source/WebCore/workers/DedicatedWorkerGlobalScope.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,43 +29,40 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DedicatedWorkerGlobalScope_h -#define DedicatedWorkerGlobalScope_h +#pragma once -#include "ContentSecurityPolicy.h" -#include "MessagePort.h" #include "WorkerGlobalScope.h" -namespace WebCore { - - class DedicatedWorkerThread; +namespace JSC { +class ExecState; +class JSObject; +class JSValue; +} - class DedicatedWorkerGlobalScope : public WorkerGlobalScope { - public: - typedef WorkerGlobalScope Base; - static PassRefPtr<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin); - virtual ~DedicatedWorkerGlobalScope(); +namespace WebCore { - virtual bool isDedicatedWorkerGlobalScope() const override { return true; } +class ContentSecurityPolicyResponseHeaders; +class DedicatedWorkerThread; +class MessagePort; +class SerializedScriptValue; - // Overridden to allow us to check our pending activity after executing imported script. - virtual void importScripts(const Vector<String>& urls, ExceptionCode&) override; +class DedicatedWorkerGlobalScope final : public WorkerGlobalScope { +public: + static Ref<DedicatedWorkerGlobalScope> create(const URL&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*); + virtual ~DedicatedWorkerGlobalScope(); - // EventTarget - virtual EventTargetInterface eventTargetInterface() const override; + ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&); - void postMessage(PassRefPtr<SerializedScriptValue>, const MessagePortArray*, ExceptionCode&); - // Needed for Objective-C bindings (see bug 28774). - void postMessage(PassRefPtr<SerializedScriptValue>, MessagePort*, ExceptionCode&); + DedicatedWorkerThread& thread(); - DEFINE_ATTRIBUTE_EVENT_LISTENER(message); +private: + using Base = WorkerGlobalScope; - DedicatedWorkerThread* thread(); + DedicatedWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*); - private: - DedicatedWorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, DedicatedWorkerThread*, PassRefPtr<SecurityOrigin> topOrigin); - }; + bool isDedicatedWorkerGlobalScope() const final { return true; } + ExceptionOr<void> importScripts(const Vector<String>& urls) final; + EventTargetInterface eventTargetInterface() const final; +}; } // namespace WebCore - -#endif // DedicatedWorkerGlobalScope_h |