OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CONTEXT_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "content/browser/service_worker/embedded_worker_status.h" |
12 #include "content/browser/service_worker/service_worker_version.h" | 13 #include "content/browser/service_worker/service_worker_version.h" |
13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 class ServiceWorkerContextObserver { | 18 class ServiceWorkerContextObserver { |
18 public: | 19 public: |
19 struct ErrorInfo { | 20 struct ErrorInfo { |
20 ErrorInfo(const base::string16& message, | 21 ErrorInfo(const base::string16& message, |
21 int line, | 22 int line, |
(...skipping 23 matching lines...) Expand all Loading... |
45 const int message_level; | 46 const int message_level; |
46 const base::string16 message; | 47 const base::string16 message; |
47 const int line_number; | 48 const int line_number; |
48 const GURL source_url; | 49 const GURL source_url; |
49 }; | 50 }; |
50 virtual void OnNewLiveRegistration(int64_t registration_id, | 51 virtual void OnNewLiveRegistration(int64_t registration_id, |
51 const GURL& pattern) {} | 52 const GURL& pattern) {} |
52 virtual void OnNewLiveVersion(int64_t version_id, | 53 virtual void OnNewLiveVersion(int64_t version_id, |
53 int64_t registration_id, | 54 int64_t registration_id, |
54 const GURL& script_url) {} | 55 const GURL& script_url) {} |
55 virtual void OnRunningStateChanged( | 56 virtual void OnRunningStateChanged(int64_t version_id, |
56 int64_t version_id, | 57 EmbeddedWorkerStatus running_status) {} |
57 ServiceWorkerVersion::RunningStatus running_status) {} | |
58 virtual void OnVersionStateChanged(int64_t version_id, | 58 virtual void OnVersionStateChanged(int64_t version_id, |
59 ServiceWorkerVersion::Status status) {} | 59 ServiceWorkerVersion::Status status) {} |
60 virtual void OnMainScriptHttpResponseInfoSet( | 60 virtual void OnMainScriptHttpResponseInfoSet( |
61 int64_t version_id, | 61 int64_t version_id, |
62 base::Time script_response_time, | 62 base::Time script_response_time, |
63 base::Time script_last_modified) {} | 63 base::Time script_last_modified) {} |
64 virtual void OnErrorReported(int64_t version_id, | 64 virtual void OnErrorReported(int64_t version_id, |
65 int process_id, | 65 int process_id, |
66 int thread_id, | 66 int thread_id, |
67 const ErrorInfo& info) {} | 67 const ErrorInfo& info) {} |
(...skipping 17 matching lines...) Expand all Loading... |
85 // data is wiped out. | 85 // data is wiped out. |
86 virtual void OnStorageWiped() {} | 86 virtual void OnStorageWiped() {} |
87 | 87 |
88 protected: | 88 protected: |
89 virtual ~ServiceWorkerContextObserver() {} | 89 virtual ~ServiceWorkerContextObserver() {} |
90 }; | 90 }; |
91 | 91 |
92 } // namespace content | 92 } // namespace content |
93 | 93 |
94 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ | 94 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ |
OLD | NEW |