 Chromium Code Reviews
 Chromium Code Reviews Issue 61023005:
  service worker scaffolding  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 61023005:
  service worker scaffolding  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 
| 6 | 6 | 
| 7 #include "content/browser/service_worker/service_worker_context.h" | 7 #include "content/browser/service_worker/service_worker_context_core.h" | 
| 8 #include "content/browser/service_worker/service_worker_context_wrapper.h" | |
| 8 #include "content/common/service_worker_messages.h" | 9 #include "content/common/service_worker_messages.h" | 
| 9 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" | 
| 10 #include "url/gurl.h" | 11 #include "url/gurl.h" | 
| 11 | 12 | 
| 12 namespace content { | 13 namespace content { | 
| 13 | 14 | 
| 14 ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost( | 15 ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost( | 
| 15 int render_process_id, | 16 int render_process_id, | 
| 16 ServiceWorkerContext* context) : context_(context) {} | 17 ServiceWorkerContextWrapper* context) : context_wrapper_(context) {} | 
| 17 | 18 | 
| 18 ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {} | 19 ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {} | 
| 19 | 20 | 
| 21 void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Channel* channel) { | |
| 22 if (context_wrapper_) { | |
| 23 context_ = context_wrapper_->context()->AsWeakPtr(); | |
| 24 context_wrapper_ = NULL; | |
| 
kinuko
2013/11/07 03:02:59
Hmm... ok I see.
 | |
| 25 } | |
| 26 } | |
| 27 | |
| 20 bool ServiceWorkerDispatcherHost::OnMessageReceived(const IPC::Message& message, | 28 bool ServiceWorkerDispatcherHost::OnMessageReceived(const IPC::Message& message, | 
| 21 bool* message_was_ok) { | 29 bool* message_was_ok) { | 
| 22 if (IPC_MESSAGE_CLASS(message) != ServiceWorkerMsgStart) | 30 if (IPC_MESSAGE_CLASS(message) != ServiceWorkerMsgStart) | 
| 23 return false; | 31 return false; | 
| 24 | 32 | 
| 25 bool handled = true; | 33 bool handled = true; | 
| 26 IPC_BEGIN_MESSAGE_MAP_EX( | 34 IPC_BEGIN_MESSAGE_MAP_EX( | 
| 27 ServiceWorkerDispatcherHost, message, *message_was_ok) | 35 ServiceWorkerDispatcherHost, message, *message_was_ok) | 
| 28 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_RegisterServiceWorker, | 36 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_RegisterServiceWorker, | 
| 29 OnRegisterServiceWorker) | 37 OnRegisterServiceWorker) | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(int32 thread_id, | 70 void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(int32 thread_id, | 
| 63 int32 request_id, | 71 int32 request_id, | 
| 64 const GURL& scope) { | 72 const GURL& scope) { | 
| 65 // TODO(alecflett): add a ServiceWorker-specific policy query in | 73 // TODO(alecflett): add a ServiceWorker-specific policy query in | 
| 66 // ChildProcessSecurityImpl. See http://crbug.com/311631. | 74 // ChildProcessSecurityImpl. See http://crbug.com/311631. | 
| 67 | 75 | 
| 68 Send(new ServiceWorkerMsg_ServiceWorkerUnregistered(thread_id, request_id)); | 76 Send(new ServiceWorkerMsg_ServiceWorkerUnregistered(thread_id, request_id)); | 
| 69 } | 77 } | 
| 70 | 78 | 
| 71 } // namespace content | 79 } // namespace content | 
| OLD | NEW |