This source file includes following definitions.
- create
- postMessageToWorkerObject
- confirmMessageFromWorkerObject
- reportPendingActivity
- reportException
- reportConsoleMessage
- postMessageToPageInspector
- updateInspectorStateCookie
- workerGlobalScopeClosed
- workerGlobalScopeDestroyed
- m_messagingProxy
#include "config.h"
#include "WorkerObjectProxy.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "core/dom/ExecutionContext.h"
#include "core/workers/WorkerMessagingProxy.h"
#include "platform/NotImplemented.h"
#include "wtf/Functional.h"
namespace WebCore {
PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(ExecutionContext* executionContext, WorkerMessagingProxy* messagingProxy)
{
return adoptPtr(new WorkerObjectProxy(executionContext, messagingProxy));
}
void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels));
}
void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity));
}
void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity));
}
void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::reportException, m_messagingProxy, errorMessage.isolatedCopy(), lineNumber, columnNumber, sourceURL.isolatedCopy()));
}
void WorkerObjectProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, source, level, message.isolatedCopy(), lineNumber, sourceURL.isolatedCopy()));
}
void WorkerObjectProxy::postMessageToPageInspector(const String& message)
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message.isolatedCopy()));
}
void WorkerObjectProxy::updateInspectorStateCookie(const String&)
{
notImplemented();
}
void WorkerObjectProxy::workerGlobalScopeClosed()
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy));
}
void WorkerObjectProxy::workerGlobalScopeDestroyed()
{
m_executionContext->postTask(bind(&WorkerMessagingProxy::workerGlobalScopeDestroyed, m_messagingProxy));
}
WorkerObjectProxy::WorkerObjectProxy(ExecutionContext* executionContext, WorkerMessagingProxy* messagingProxy)
: m_executionContext(executionContext)
, m_messagingProxy(messagingProxy)
{
}
}