| 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_REGISTER_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 public EmbeddedWorkerInstance::Listener { | 41 public EmbeddedWorkerInstance::Listener { |
| 42 public: | 42 public: |
| 43 typedef base::Callback<void(ServiceWorkerStatusCode status, | 43 typedef base::Callback<void(ServiceWorkerStatusCode status, |
| 44 const std::string& status_message, | 44 const std::string& status_message, |
| 45 ServiceWorkerRegistration* registration)> | 45 ServiceWorkerRegistration* registration)> |
| 46 RegistrationCallback; | 46 RegistrationCallback; |
| 47 | 47 |
| 48 // For registration jobs. | 48 // For registration jobs. |
| 49 CONTENT_EXPORT ServiceWorkerRegisterJob( | 49 CONTENT_EXPORT ServiceWorkerRegisterJob( |
| 50 base::WeakPtr<ServiceWorkerContextCore> context, | 50 base::WeakPtr<ServiceWorkerContextCore> context, |
| 51 const GURL& pattern, | 51 const GURL& script_url, |
| 52 const GURL& script_url); | 52 const ServiceWorkerRegistrationOptions& options); |
| 53 | 53 |
| 54 // For update jobs. | 54 // For update jobs. |
| 55 CONTENT_EXPORT ServiceWorkerRegisterJob( | 55 CONTENT_EXPORT ServiceWorkerRegisterJob( |
| 56 base::WeakPtr<ServiceWorkerContextCore> context, | 56 base::WeakPtr<ServiceWorkerContextCore> context, |
| 57 ServiceWorkerRegistration* registration, | 57 ServiceWorkerRegistration* registration, |
| 58 bool force_bypass_cache, | 58 bool force_bypass_cache, |
| 59 bool skip_script_comparison); | 59 bool skip_script_comparison); |
| 60 ~ServiceWorkerRegisterJob() override; | 60 ~ServiceWorkerRegisterJob() override; |
| 61 | 61 |
| 62 // Registers a callback to be called when the promise would resolve (whether | 62 // Registers a callback to be called when the promise would resolve (whether |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 void OnScriptLoaded() override; | 147 void OnScriptLoaded() override; |
| 148 | 148 |
| 149 void BumpLastUpdateCheckTimeIfNeeded(); | 149 void BumpLastUpdateCheckTimeIfNeeded(); |
| 150 | 150 |
| 151 // The ServiceWorkerContextCore object should always outlive this. | 151 // The ServiceWorkerContextCore object should always outlive this. |
| 152 base::WeakPtr<ServiceWorkerContextCore> context_; | 152 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 153 | 153 |
| 154 RegistrationJobType job_type_; | 154 RegistrationJobType job_type_; |
| 155 const GURL pattern_; | 155 const GURL pattern_; |
| 156 GURL script_url_; | 156 GURL script_url_; |
| 157 const blink::WebServiceWorkerUpdateViaCache update_via_cache_; |
| 157 std::vector<RegistrationCallback> callbacks_; | 158 std::vector<RegistrationCallback> callbacks_; |
| 158 Phase phase_; | 159 Phase phase_; |
| 159 Internal internal_; | 160 Internal internal_; |
| 160 bool doom_installing_worker_; | 161 bool doom_installing_worker_; |
| 161 bool is_promise_resolved_; | 162 bool is_promise_resolved_; |
| 162 bool should_uninstall_on_failure_; | 163 bool should_uninstall_on_failure_; |
| 163 bool force_bypass_cache_; | 164 bool force_bypass_cache_; |
| 164 bool skip_script_comparison_; | 165 bool skip_script_comparison_; |
| 165 ServiceWorkerStatusCode promise_resolved_status_; | 166 ServiceWorkerStatusCode promise_resolved_status_; |
| 166 std::string promise_resolved_status_message_; | 167 std::string promise_resolved_status_message_; |
| 167 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; | 168 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; |
| 168 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; | 169 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; |
| 169 | 170 |
| 170 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); | 171 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 } // namespace content | 174 } // namespace content |
| 174 | 175 |
| 175 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | 176 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| OLD | NEW |