| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 INSTALLING, // Install event is dispatched and being handled. | 67 INSTALLING, // Install event is dispatched and being handled. |
| 68 INSTALLED, // Install event is finished and is ready to be activated. | 68 INSTALLED, // Install event is finished and is ready to be activated. |
| 69 ACTIVATING, // Activate event is dispatched and being handled. | 69 ACTIVATING, // Activate event is dispatched and being handled. |
| 70 ACTIVE, // Activation is finished and can run as active. | 70 ACTIVE, // Activation is finished and can run as active. |
| 71 REDUNDANT, // The version is no longer running as active, due to | 71 REDUNDANT, // The version is no longer running as active, due to |
| 72 // unregistration or replace. | 72 // unregistration or replace. |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 class Listener { | 75 class Listener { |
| 76 public: | 76 public: |
| 77 virtual void OnWorkerStarted(ServiceWorkerVersion* version) = 0; | 77 virtual void OnWorkerStarted(ServiceWorkerVersion* version) {}; |
| 78 virtual void OnWorkerStopped(ServiceWorkerVersion* version) = 0; | 78 virtual void OnWorkerStopped(ServiceWorkerVersion* version) {}; |
| 79 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) = 0; | 79 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {}; |
| 80 virtual void OnErrorReported(ServiceWorkerVersion* version, | 80 virtual void OnErrorReported(ServiceWorkerVersion* version, |
| 81 const base::string16& error_message, | 81 const base::string16& error_message, |
| 82 int line_number, | 82 int line_number, |
| 83 int column_number, | 83 int column_number, |
| 84 const GURL& source_url) = 0; | 84 const GURL& source_url) {}; |
| 85 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, | 85 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, |
| 86 int source_identifier, | 86 int source_identifier, |
| 87 int message_level, | 87 int message_level, |
| 88 const base::string16& message, | 88 const base::string16& message, |
| 89 int line_number, | 89 int line_number, |
| 90 const GURL& source_url) = 0; | 90 const GURL& source_url) {}; |
| 91 virtual void OnNoControllees(ServiceWorkerVersion* version) {}; |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 ServiceWorkerVersion( | 94 ServiceWorkerVersion( |
| 94 ServiceWorkerRegistration* registration, | 95 ServiceWorkerRegistration* registration, |
| 95 int64 version_id, | 96 int64 version_id, |
| 96 base::WeakPtr<ServiceWorkerContextCore> context); | 97 base::WeakPtr<ServiceWorkerContextCore> context); |
| 97 | 98 |
| 98 int64 version_id() const { return version_id_; } | 99 int64 version_id() const { return version_id_; } |
| 99 int64 registration_id() const { return registration_id_; } | 100 int64 registration_id() const { return registration_id_; } |
| 100 const GURL& script_url() const { return script_url_; } | 101 const GURL& script_url() const { return script_url_; } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 291 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
| 291 | 292 |
| 292 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 293 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 293 | 294 |
| 294 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 295 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 295 }; | 296 }; |
| 296 | 297 |
| 297 } // namespace content | 298 } // namespace content |
| 298 | 299 |
| 299 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 300 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |