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