| 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_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 struct WebCircularGeofencingRegion; | 32 struct WebCircularGeofencingRegion; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 | 36 |
| 37 class EmbeddedWorkerRegistry; | 37 class EmbeddedWorkerRegistry; |
| 38 class ServiceWorkerContextCore; | 38 class ServiceWorkerContextCore; |
| 39 class ServiceWorkerProviderHost; | 39 class ServiceWorkerProviderHost; |
| 40 class ServiceWorkerRegistration; | 40 class ServiceWorkerRegistration; |
| 41 class ServiceWorkerVersionInfo; | 41 class ServiceWorkerVersionInfo; |
| 42 struct ShowDesktopNotificationHostMsgParams; |
| 42 | 43 |
| 43 // This class corresponds to a specific version of a ServiceWorker | 44 // This class corresponds to a specific version of a ServiceWorker |
| 44 // script for a given pattern. When a script is upgraded, there may be | 45 // script for a given pattern. When a script is upgraded, there may be |
| 45 // more than one ServiceWorkerVersion "running" at a time, but only | 46 // more than one ServiceWorkerVersion "running" at a time, but only |
| 46 // one of them is activated. This class connects the actual script with a | 47 // one of them is activated. This class connects the actual script with a |
| 47 // running worker. | 48 // running worker. |
| 48 class CONTENT_EXPORT ServiceWorkerVersion | 49 class CONTENT_EXPORT ServiceWorkerVersion |
| 49 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>), | 50 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>), |
| 50 public EmbeddedWorkerInstance::Listener { | 51 public EmbeddedWorkerInstance::Listener { |
| 51 public: | 52 public: |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // notify completion. | 198 // notify completion. |
| 198 // | 199 // |
| 199 // This must be called when the status() is ACTIVATED. | 200 // This must be called when the status() is ACTIVATED. |
| 200 void DispatchSyncEvent(const StatusCallback& callback); | 201 void DispatchSyncEvent(const StatusCallback& callback); |
| 201 | 202 |
| 202 // Sends notificationclick event to the associated embedded worker and | 203 // Sends notificationclick event to the associated embedded worker and |
| 203 // asynchronously calls |callback| when it errors out or it gets a response | 204 // asynchronously calls |callback| when it errors out or it gets a response |
| 204 // from the worker to notify completion. | 205 // from the worker to notify completion. |
| 205 // | 206 // |
| 206 // This must be called when the status() is ACTIVATED. | 207 // This must be called when the status() is ACTIVATED. |
| 207 void DispatchNotificationClickEvent(const StatusCallback& callback, | 208 void DispatchNotificationClickEvent( |
| 208 const std::string& notification_id); | 209 const StatusCallback& callback, |
| 210 const std::string& notification_id, |
| 211 const ShowDesktopNotificationHostMsgParams& notification_data); |
| 209 | 212 |
| 210 // Sends push event to the associated embedded worker and asynchronously calls | 213 // Sends push event to the associated embedded worker and asynchronously calls |
| 211 // |callback| when it errors out or it gets a response from the worker to | 214 // |callback| when it errors out or it gets a response from the worker to |
| 212 // notify completion. | 215 // notify completion. |
| 213 // | 216 // |
| 214 // This must be called when the status() is ACTIVATED. | 217 // This must be called when the status() is ACTIVATED. |
| 215 void DispatchPushEvent(const StatusCallback& callback, | 218 void DispatchPushEvent(const StatusCallback& callback, |
| 216 const std::string& data); | 219 const std::string& data); |
| 217 | 220 |
| 218 // Sends geofencing event to the associated embedded worker and asynchronously | 221 // Sends geofencing event to the associated embedded worker and asynchronously |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 bool is_doomed_; | 341 bool is_doomed_; |
| 339 | 342 |
| 340 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 343 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 341 | 344 |
| 342 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 345 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 343 }; | 346 }; |
| 344 | 347 |
| 345 } // namespace content | 348 } // namespace content |
| 346 | 349 |
| 347 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 350 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |