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) {} | |
falken
2014/07/17 06:33:43
Can we add a comment "Called when a version that c
| |
88 | |
89 protected: | |
90 virtual ~Listener() {} | |
87 }; | 91 }; |
88 | 92 |
89 ServiceWorkerVersion( | 93 ServiceWorkerVersion( |
90 ServiceWorkerRegistration* registration, | 94 ServiceWorkerRegistration* registration, |
91 int64 version_id, | 95 int64 version_id, |
92 base::WeakPtr<ServiceWorkerContextCore> context); | 96 base::WeakPtr<ServiceWorkerContextCore> context); |
93 | 97 |
94 int64 version_id() const { return version_id_; } | 98 int64 version_id() const { return version_id_; } |
95 int64 registration_id() const { return registration_id_; } | 99 int64 registration_id() const { return registration_id_; } |
96 const GURL& script_url() const { return script_url_; } | 100 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_; | 299 bool is_doomed_; |
296 | 300 |
297 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 301 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
298 | 302 |
299 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 303 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
300 }; | 304 }; |
301 | 305 |
302 } // namespace content | 306 } // namespace content |
303 | 307 |
304 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 308 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |