This source file includes following definitions.
- create
- interfaceName
- postMessage
- importScripts
- thread
- trace
#include "config.h"
#include "core/workers/DedicatedWorkerGlobalScope.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "core/frame/DOMWindow.h"
#include "core/workers/DedicatedWorkerThread.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerObjectProxy.h"
#include "core/workers/WorkerThreadStartupData.h"
namespace WebCore {
PassRefPtrWillBeRawPtr<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(DedicatedWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData, double timeOrigin)
{
RefPtrWillBeRawPtr<DedicatedWorkerGlobalScope> context = adoptRefWillBeRefCountedGarbageCollected(new DedicatedWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, thread, timeOrigin, startupData->m_workerClients.release()));
context->applyContentSecurityPolicyFromString(startupData->m_contentSecurityPolicy, startupData->m_contentSecurityPolicyType);
return context.release();
}
DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread, double timeOrigin, PassOwnPtr<WorkerClients> workerClients)
: WorkerGlobalScope(url, userAgent, thread, timeOrigin, workerClients)
{
ScriptWrappable::init(this);
}
DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope()
{
}
const AtomicString& DedicatedWorkerGlobalScope::interfaceName() const
{
return EventTargetNames::DedicatedWorkerGlobalScope;
}
void DedicatedWorkerGlobalScope::postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionState)
{
OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(ports, exceptionState);
if (exceptionState.hadException())
return;
thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.release());
}
void DedicatedWorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
{
Base::importScripts(urls, exceptionState);
thread()->workerObjectProxy().reportPendingActivity(hasPendingActivity());
}
DedicatedWorkerThread* DedicatedWorkerGlobalScope::thread()
{
return static_cast<DedicatedWorkerThread*>(Base::thread());
}
void DedicatedWorkerGlobalScope::trace(Visitor* visitor)
{
WorkerGlobalScope::trace(visitor);
}
}