OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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/browser/service_worker/service_worker_dispatcher_host.h" |
| 6 |
| 7 #include "content/browser/service_worker/service_worker_context.h" |
| 8 #include "content/common/service_worker_messages.h" |
| 9 #include "ipc/ipc_message_macros.h" |
| 10 #include "url/gurl.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost( |
| 15 ServiceWorkerContext* context) |
| 16 : context_(context) {} |
| 17 |
| 18 ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {} |
| 19 |
| 20 bool ServiceWorkerDispatcherHost::OnMessageReceived(const IPC::Message& message, |
| 21 bool* message_was_ok) { |
| 22 |
| 23 if (IPC_MESSAGE_CLASS(message) != ServiceWorkerMsgStart) |
| 24 return false; |
| 25 |
| 26 bool handled = true; |
| 27 IPC_BEGIN_MESSAGE_MAP_EX( |
| 28 ServiceWorkerDispatcherHost, message, *message_was_ok) |
| 29 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_RegisterServiceWorker, |
| 30 OnRegisterServiceWorker) |
| 31 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_UnregisterServiceWorker, |
| 32 OnUnregisterServiceWorker) |
| 33 IPC_MESSAGE_UNHANDLED(handled = false) |
| 34 IPC_END_MESSAGE_MAP() |
| 35 |
| 36 return handled; |
| 37 } |
| 38 |
| 39 void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(int32 registry_id, |
| 40 const string16& scope, |
| 41 const GURL& script_url) { |
| 42 // TODO(alecflett): Enforce that script_url must have the same |
| 43 // origin as the registering document. |
| 44 } |
| 45 |
| 46 void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( |
| 47 int32 registry_id, |
| 48 const string16& scope) {} |
| 49 |
| 50 } // namespace content |
OLD | NEW |