This source file includes following definitions.
- create
- didHandleActivateEvent
- didHandleInstallEvent
- didHandleFetchEvent
- didHandleSyncEvent
#include "config.h"
#include "ServiceWorkerGlobalScopeClientImpl.h"
#include "WebServiceWorkerContextClient.h"
#include "modules/serviceworkers/Response.h"
#include "platform/NotImplemented.h"
#include "public/platform/WebServiceWorkerResponse.h"
#include "wtf/PassOwnPtr.h"
namespace blink {
PassOwnPtr<WebCore::ServiceWorkerGlobalScopeClient> ServiceWorkerGlobalScopeClientImpl::create(PassOwnPtr<WebServiceWorkerContextClient> client)
{
return adoptPtr(new ServiceWorkerGlobalScopeClientImpl(client));
}
ServiceWorkerGlobalScopeClientImpl::~ServiceWorkerGlobalScopeClientImpl()
{
}
void ServiceWorkerGlobalScopeClientImpl::didHandleActivateEvent(int eventID, WebServiceWorkerEventResult result)
{
m_client->didHandleActivateEvent(eventID, result);
}
void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventID, WebServiceWorkerEventResult result)
{
m_client->didHandleInstallEvent(installEventID, result);
}
void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, PassRefPtr<WebCore::Response> response)
{
if (!response) {
m_client->didHandleFetchEvent(fetchEventID);
return;
}
WebServiceWorkerResponse webResponse;
response->populateWebServiceWorkerResponse(webResponse);
m_client->didHandleFetchEvent(fetchEventID, webResponse);
}
void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID)
{
m_client->didHandleSyncEvent(syncEventID);
}
ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(PassOwnPtr<WebServiceWorkerContextClient> client)
: m_client(client)
{
ASSERT(m_client);
}
}