| 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/service_worker_version.h" | 12 #include "content/browser/service_worker/service_worker_version.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 enum class EmbeddedWorkerStatus; |
| 18 |
| 17 class ServiceWorkerContextObserver { | 19 class ServiceWorkerContextObserver { |
| 18 public: | 20 public: |
| 19 struct ErrorInfo { | 21 struct ErrorInfo { |
| 20 ErrorInfo(const base::string16& message, | 22 ErrorInfo(const base::string16& message, |
| 21 int line, | 23 int line, |
| 22 int column, | 24 int column, |
| 23 const GURL& url) | 25 const GURL& url) |
| 24 : error_message(message), | 26 : error_message(message), |
| 25 line_number(line), | 27 line_number(line), |
| 26 column_number(column), | 28 column_number(column), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 45 const int message_level; | 47 const int message_level; |
| 46 const base::string16 message; | 48 const base::string16 message; |
| 47 const int line_number; | 49 const int line_number; |
| 48 const GURL source_url; | 50 const GURL source_url; |
| 49 }; | 51 }; |
| 50 virtual void OnNewLiveRegistration(int64_t registration_id, | 52 virtual void OnNewLiveRegistration(int64_t registration_id, |
| 51 const GURL& pattern) {} | 53 const GURL& pattern) {} |
| 52 virtual void OnNewLiveVersion(int64_t version_id, | 54 virtual void OnNewLiveVersion(int64_t version_id, |
| 53 int64_t registration_id, | 55 int64_t registration_id, |
| 54 const GURL& script_url) {} | 56 const GURL& script_url) {} |
| 55 virtual void OnRunningStateChanged( | 57 virtual void OnRunningStateChanged(int64_t version_id, |
| 56 int64_t version_id, | 58 EmbeddedWorkerStatus running_status) {} |
| 57 ServiceWorkerVersion::RunningStatus running_status) {} | |
| 58 virtual void OnVersionStateChanged(int64_t version_id, | 59 virtual void OnVersionStateChanged(int64_t version_id, |
| 59 ServiceWorkerVersion::Status status) {} | 60 ServiceWorkerVersion::Status status) {} |
| 60 virtual void OnMainScriptHttpResponseInfoSet( | 61 virtual void OnMainScriptHttpResponseInfoSet( |
| 61 int64_t version_id, | 62 int64_t version_id, |
| 62 base::Time script_response_time, | 63 base::Time script_response_time, |
| 63 base::Time script_last_modified) {} | 64 base::Time script_last_modified) {} |
| 64 virtual void OnErrorReported(int64_t version_id, | 65 virtual void OnErrorReported(int64_t version_id, |
| 65 int process_id, | 66 int process_id, |
| 66 int thread_id, | 67 int thread_id, |
| 67 const ErrorInfo& info) {} | 68 const ErrorInfo& info) {} |
| (...skipping 17 matching lines...) Expand all Loading... |
| 85 // data is wiped out. | 86 // data is wiped out. |
| 86 virtual void OnStorageWiped() {} | 87 virtual void OnStorageWiped() {} |
| 87 | 88 |
| 88 protected: | 89 protected: |
| 89 virtual ~ServiceWorkerContextObserver() {} | 90 virtual ~ServiceWorkerContextObserver() {} |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 } // namespace content | 93 } // namespace content |
| 93 | 94 |
| 94 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ | 95 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_ |
| OLD | NEW |