OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/renderer/service_worker/service_worker_script_context.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "content/common/service_worker/service_worker_messages.h" |
| 9 #include "content/renderer/service_worker/embedded_worker_context_client.h" |
| 10 #include "ipc/ipc_message.h" |
| 11 #include "third_party/WebKit/public/web/WebServiceWorkerContextProxy.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 ServiceWorkerScriptContext::ServiceWorkerScriptContext( |
| 16 EmbeddedWorkerContextClient* embedded_context, |
| 17 blink::WebServiceWorkerContextProxy* proxy) |
| 18 : embedded_context_(embedded_context), |
| 19 proxy_(proxy) { |
| 20 } |
| 21 |
| 22 ServiceWorkerScriptContext::~ServiceWorkerScriptContext() {} |
| 23 |
| 24 void ServiceWorkerScriptContext::OnMessageReceived( |
| 25 const IPC::Message& message) { |
| 26 bool handled = true; |
| 27 IPC_BEGIN_MESSAGE_MAP(ServiceWorkerScriptContext, message) |
| 28 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FetchEvent, OnFetchEvent) |
| 29 IPC_MESSAGE_UNHANDLED(handled = false) |
| 30 IPC_END_MESSAGE_MAP() |
| 31 DCHECK(handled); |
| 32 } |
| 33 |
| 34 void ServiceWorkerScriptContext::Send(const IPC::Message& message) { |
| 35 embedded_context_->SendMessageToBrowser(message); |
| 36 } |
| 37 |
| 38 void ServiceWorkerScriptContext::OnFetchEvent( |
| 39 const ServiceWorkerFetchRequest& request) { |
| 40 NOTIMPLEMENTED(); |
| 41 } |
| 42 |
| 43 } // namespace content |
OLD | NEW |