| 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // be destroyed. | 57 // be destroyed. |
| 58 bool Send(IPC::Message* message) override; | 58 bool Send(IPC::Message* message) override; |
| 59 | 59 |
| 60 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); | 60 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
| 61 void RegisterServiceWorkerRegistrationHandle( | 61 void RegisterServiceWorkerRegistrationHandle( |
| 62 scoped_ptr<ServiceWorkerRegistrationHandle> handle); | 62 scoped_ptr<ServiceWorkerRegistrationHandle> handle); |
| 63 | 63 |
| 64 ServiceWorkerHandle* FindServiceWorkerHandle(int provider_id, | 64 ServiceWorkerHandle* FindServiceWorkerHandle(int provider_id, |
| 65 int64 version_id); | 65 int64 version_id); |
| 66 | 66 |
| 67 // Returns the existing registration handle whose reference count is | 67 // Creates a new registration handle and registers it. |
| 68 // incremented or newly created one if it doesn't exist. | 68 ServiceWorkerRegistrationHandle* CreateRegistrationHandle( |
| 69 ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle( | |
| 70 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 69 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 71 ServiceWorkerRegistration* registration); | 70 ServiceWorkerRegistration* registration); |
| 72 | 71 |
| 73 MessagePortMessageFilter* message_port_message_filter() { | 72 MessagePortMessageFilter* message_port_message_filter() { |
| 74 return message_port_message_filter_; | 73 return message_port_message_filter_; |
| 75 } | 74 } |
| 76 | 75 |
| 77 protected: | 76 protected: |
| 78 ~ServiceWorkerDispatcherHost() override; | 77 ~ServiceWorkerDispatcherHost() override; |
| 79 | 78 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void OnDecrementServiceWorkerRefCount(int handle_id); | 128 void OnDecrementServiceWorkerRefCount(int handle_id); |
| 130 void OnIncrementRegistrationRefCount(int registration_handle_id); | 129 void OnIncrementRegistrationRefCount(int registration_handle_id); |
| 131 void OnDecrementRegistrationRefCount(int registration_handle_id); | 130 void OnDecrementRegistrationRefCount(int registration_handle_id); |
| 132 void OnPostMessageToWorker( | 131 void OnPostMessageToWorker( |
| 133 int handle_id, | 132 int handle_id, |
| 134 const base::string16& message, | 133 const base::string16& message, |
| 135 const std::vector<TransferredMessagePort>& sent_message_ports); | 134 const std::vector<TransferredMessagePort>& sent_message_ports); |
| 136 void OnServiceWorkerObjectDestroyed(int handle_id); | 135 void OnServiceWorkerObjectDestroyed(int handle_id); |
| 137 void OnTerminateWorker(int handle_id); | 136 void OnTerminateWorker(int handle_id); |
| 138 | 137 |
| 139 ServiceWorkerRegistrationHandle* FindRegistrationHandle( | |
| 140 int provider_id, | |
| 141 int64 registration_id); | |
| 142 | |
| 143 void GetRegistrationObjectInfoAndVersionAttributes( | 138 void GetRegistrationObjectInfoAndVersionAttributes( |
| 144 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 139 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 145 ServiceWorkerRegistration* registration, | 140 ServiceWorkerRegistration* registration, |
| 146 ServiceWorkerRegistrationObjectInfo* info, | 141 ServiceWorkerRegistrationObjectInfo* info, |
| 147 ServiceWorkerVersionAttributes* attrs); | 142 ServiceWorkerVersionAttributes* attrs); |
| 148 | 143 |
| 149 // Callbacks from ServiceWorkerContextCore | 144 // Callbacks from ServiceWorkerContextCore |
| 150 void RegistrationComplete(int thread_id, | 145 void RegistrationComplete(int thread_id, |
| 151 int provider_id, | 146 int provider_id, |
| 152 int request_id, | 147 int request_id, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 214 |
| 220 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 215 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
| 221 ScopedVector<IPC::Message> pending_messages_; | 216 ScopedVector<IPC::Message> pending_messages_; |
| 222 | 217 |
| 223 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 218 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
| 224 }; | 219 }; |
| 225 | 220 |
| 226 } // namespace content | 221 } // namespace content |
| 227 | 222 |
| 228 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 223 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| OLD | NEW |