| Index: Source/modules/serviceworkers/ServiceWorkerClient.cpp
|
| diff --git a/Source/modules/serviceworkers/ServiceWorkerClient.cpp b/Source/modules/serviceworkers/ServiceWorkerClient.cpp
|
| index 57ab08a2eb23c4b3c75a200154c59bd2d1d900d0..66bf83136b0992896cd2d75158702d4e02196821 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorkerClient.cpp
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerClient.cpp
|
| @@ -16,16 +16,46 @@
|
|
|
| namespace blink {
|
|
|
| -ServiceWorkerClient* ServiceWorkerClient::create(unsigned id)
|
| +ServiceWorkerClient* ServiceWorkerClient::create(const WebServiceWorkerClientInfo& info)
|
| {
|
| - return new ServiceWorkerClient(id);
|
| + return new ServiceWorkerClient(info);
|
| }
|
|
|
| -ServiceWorkerClient::ServiceWorkerClient(unsigned id)
|
| - : m_id(id)
|
| +ServiceWorkerClient::ServiceWorkerClient(const WebServiceWorkerClientInfo& info)
|
| + : m_id(info.clientID)
|
| + , m_visibilityState(info.visibilityState)
|
| + , m_isFocused(info.isFocused)
|
| + , m_url(info.url.string())
|
| + , m_frameType(info.frameType)
|
| {
|
| }
|
|
|
| +ServiceWorkerClient::~ServiceWorkerClient()
|
| +{
|
| +}
|
| +
|
| +String ServiceWorkerClient::frameType() const
|
| +{
|
| + DEFINE_STATIC_LOCAL(const String, auxiliary, ("auxiliary"));
|
| + DEFINE_STATIC_LOCAL(const String, nested, ("nested"));
|
| + DEFINE_STATIC_LOCAL(const String, none, ("none"));
|
| + DEFINE_STATIC_LOCAL(const String, topLevel, ("top-level"));
|
| +
|
| + switch (m_frameType) {
|
| + case WebURLRequest::FrameTypeAuxiliary:
|
| + return auxiliary;
|
| + case WebURLRequest::FrameTypeNested:
|
| + return nested;
|
| + case WebURLRequest::FrameTypeNone:
|
| + return none;
|
| + case WebURLRequest::FrameTypeTopLevel:
|
| + return topLevel;
|
| + }
|
| +
|
| + ASSERT_NOT_REACHED();
|
| + return String();
|
| +}
|
| +
|
| void ServiceWorkerClient::postMessage(ExecutionContext* context, PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionState)
|
| {
|
| // Disentangle the port in preparation for sending it to the remote context.
|
|
|