This source file includes following definitions.
- createConnectEvent
- create
- m_name
- interfaceName
- thread
- logExceptionToConsole
- trace
#include "config.h"
#include "core/workers/SharedWorkerGlobalScope.h"
#include "core/events/MessageEvent.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/frame/DOMWindow.h"
#include "core/workers/SharedWorkerThread.h"
#include "core/workers/WorkerClients.h"
#include "wtf/CurrentTime.h"
namespace WebCore {
PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> prpPort)
{
RefPtr<MessagePort> port = prpPort;
RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, port)), String(), String(), port);
event->initEvent(EventTypeNames::connect, false, false);
return event.release();
}
PassRefPtrWillBeRawPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create(const String& name, SharedWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData)
{
RefPtrWillBeRawPtr<SharedWorkerGlobalScope> context = adoptRefWillBeRefCountedGarbageCollected(new SharedWorkerGlobalScope(name, startupData->m_scriptURL, startupData->m_userAgent, thread, startupData->m_workerClients.release()));
context->applyContentSecurityPolicyFromString(startupData->m_contentSecurityPolicy, startupData->m_contentSecurityPolicyType);
return context.release();
}
SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread, PassOwnPtr<WorkerClients> workerClients)
: WorkerGlobalScope(url, userAgent, thread, monotonicallyIncreasingTime(), workerClients)
, m_name(name)
{
ScriptWrappable::init(this);
}
SharedWorkerGlobalScope::~SharedWorkerGlobalScope()
{
}
const AtomicString& SharedWorkerGlobalScope::interfaceName() const
{
return EventTargetNames::SharedWorkerGlobalScope;
}
SharedWorkerThread* SharedWorkerGlobalScope::thread()
{
return static_cast<SharedWorkerThread*>(Base::thread());
}
void SharedWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack> callStack)
{
WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack);
addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0);
}
void SharedWorkerGlobalScope::trace(Visitor* visitor)
{
WorkerGlobalScope::trace(visitor);
}
}