Chromium Code Reviews| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 INSTALLING, // Install event is dispatched and being handled. | 63 INSTALLING, // Install event is dispatched and being handled. |
| 64 INSTALLED, // Install event is finished and is ready to be activated. | 64 INSTALLED, // Install event is finished and is ready to be activated. |
| 65 ACTIVATING, // Activate event is dispatched and being handled. | 65 ACTIVATING, // Activate event is dispatched and being handled. |
| 66 ACTIVATED, // Activation is finished and can run as activated. | 66 ACTIVATED, // Activation is finished and can run as activated. |
| 67 REDUNDANT, // The version is no longer running as activated, due to | 67 REDUNDANT, // The version is no longer running as activated, due to |
| 68 // unregistration or replace. | 68 // unregistration or replace. |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class Listener { | 71 class Listener { |
| 72 public: | 72 public: |
| 73 virtual void OnWorkerStarted(ServiceWorkerVersion* version) {}; | 73 virtual void OnWorkerStarted(ServiceWorkerVersion* version) {} |
| 74 virtual void OnWorkerStopped(ServiceWorkerVersion* version) {}; | 74 virtual void OnWorkerStopped(ServiceWorkerVersion* version) {} |
| 75 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {}; | 75 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {} |
| 76 virtual void OnErrorReported(ServiceWorkerVersion* version, | 76 virtual void OnErrorReported(ServiceWorkerVersion* version, |
| 77 const base::string16& error_message, | 77 const base::string16& error_message, |
| 78 int line_number, | 78 int line_number, |
| 79 int column_number, | 79 int column_number, |
| 80 const GURL& source_url) {}; | 80 const GURL& source_url) {} |
| 81 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, | 81 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, |
| 82 int source_identifier, | 82 int source_identifier, |
| 83 int message_level, | 83 int message_level, |
| 84 const base::string16& message, | 84 const base::string16& message, |
| 85 int line_number, | 85 int line_number, |
| 86 const GURL& source_url) {}; | 86 const GURL& source_url) {} |
| 87 virtual void OnNoControllees(ServiceWorkerVersion* version) {} | |
| 88 protected: | |
|
nhiroki
2014/07/15 03:57:04
style-nit: can you insert a blank line before 'pro
michaeln
2014/07/16 00:32:53
Done.
| |
| 89 virtual ~Listener() {} | |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 ServiceWorkerVersion( | 92 ServiceWorkerVersion( |
| 90 ServiceWorkerRegistration* registration, | 93 ServiceWorkerRegistration* registration, |
| 91 int64 version_id, | 94 int64 version_id, |
| 92 base::WeakPtr<ServiceWorkerContextCore> context); | 95 base::WeakPtr<ServiceWorkerContextCore> context); |
| 93 | 96 |
| 94 int64 version_id() const { return version_id_; } | 97 int64 version_id() const { return version_id_; } |
| 95 int64 registration_id() const { return registration_id_; } | 98 int64 registration_id() const { return registration_id_; } |
| 96 const GURL& script_url() const { return script_url_; } | 99 const GURL& script_url() const { return script_url_; } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 bool is_doomed_; | 298 bool is_doomed_; |
| 296 | 299 |
| 297 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 300 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 298 | 301 |
| 299 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 302 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 300 }; | 303 }; |
| 301 | 304 |
| 302 } // namespace content | 305 } // namespace content |
| 303 | 306 |
| 304 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 307 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |