| Index: content/renderer/service_worker/service_worker_script_context.cc
|
| diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e29dd3233f5c352bec277de2c8ee61a90750afa2
|
| --- /dev/null
|
| +++ b/content/renderer/service_worker/service_worker_script_context.cc
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/renderer/service_worker/service_worker_script_context.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "content/common/service_worker/service_worker_messages.h"
|
| +#include "content/renderer/service_worker/embedded_worker_context_client.h"
|
| +#include "ipc/ipc_message.h"
|
| +#include "third_party/WebKit/public/web/WebServiceWorkerContextProxy.h"
|
| +
|
| +namespace content {
|
| +
|
| +ServiceWorkerScriptContext::ServiceWorkerScriptContext(
|
| + EmbeddedWorkerContextClient* embedded_context,
|
| + blink::WebServiceWorkerContextProxy* proxy)
|
| + : embedded_context_(embedded_context),
|
| + proxy_(proxy) {
|
| +}
|
| +
|
| +ServiceWorkerScriptContext::~ServiceWorkerScriptContext() {}
|
| +
|
| +void ServiceWorkerScriptContext::OnMessageReceived(
|
| + const IPC::Message& message) {
|
| + bool handled = true;
|
| + IPC_BEGIN_MESSAGE_MAP(ServiceWorkerScriptContext, message)
|
| + IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FetchEvent, OnFetchEvent)
|
| + IPC_MESSAGE_UNHANDLED(handled = false)
|
| + IPC_END_MESSAGE_MAP()
|
| + DCHECK(handled);
|
| +}
|
| +
|
| +void ServiceWorkerScriptContext::Send(const IPC::Message& message) {
|
| + embedded_context_->SendMessageToBrowser(message);
|
| +}
|
| +
|
| +void ServiceWorkerScriptContext::OnFetchEvent(
|
| + const ServiceWorkerFetchRequest& request) {
|
| + NOTIMPLEMENTED();
|
| +}
|
| +
|
| +} // namespace content
|
|
|