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