| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 struct Internal { | 89 struct Internal { |
| 90 Internal(); | 90 Internal(); |
| 91 ~Internal(); | 91 ~Internal(); |
| 92 scoped_refptr<ServiceWorkerRegistration> registration; | 92 scoped_refptr<ServiceWorkerRegistration> registration; |
| 93 | 93 |
| 94 // Holds the version created by this job. It can be the 'installing', | 94 // Holds the version created by this job. It can be the 'installing', |
| 95 // 'waiting', or 'active' version depending on the phase. | 95 // 'waiting', or 'active' version depending on the phase. |
| 96 scoped_refptr<ServiceWorkerVersion> new_version; | 96 scoped_refptr<ServiceWorkerVersion> new_version; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 void set_registration(scoped_refptr<ServiceWorkerRegistration> registration); | 99 void set_registration( |
| 100 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 100 ServiceWorkerRegistration* registration(); | 101 ServiceWorkerRegistration* registration(); |
| 101 void set_new_version(ServiceWorkerVersion* version); | 102 void set_new_version(ServiceWorkerVersion* version); |
| 102 ServiceWorkerVersion* new_version(); | 103 ServiceWorkerVersion* new_version(); |
| 103 | 104 |
| 104 void SetPhase(Phase phase); | 105 void SetPhase(Phase phase); |
| 105 | 106 |
| 106 void StartImpl(); | 107 void StartImpl(); |
| 107 void ContinueWithRegistration( | 108 void ContinueWithRegistration( |
| 108 ServiceWorkerStatusCode status, | 109 ServiceWorkerStatusCode status, |
| 109 scoped_refptr<ServiceWorkerRegistration> registration); | 110 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 110 void ContinueWithUpdate( | 111 void ContinueWithUpdate( |
| 111 ServiceWorkerStatusCode status, | 112 ServiceWorkerStatusCode status, |
| 112 scoped_refptr<ServiceWorkerRegistration> registration); | 113 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 113 void RegisterAndContinue(); | 114 void RegisterAndContinue(); |
| 114 void ContinueWithUninstallingRegistration( | 115 void ContinueWithUninstallingRegistration( |
| 115 scoped_refptr<ServiceWorkerRegistration> existing_registration, | 116 const scoped_refptr<ServiceWorkerRegistration>& existing_registration, |
| 116 ServiceWorkerStatusCode status); | 117 ServiceWorkerStatusCode status); |
| 117 void ContinueWithRegistrationForSameScriptUrl( | 118 void ContinueWithRegistrationForSameScriptUrl( |
| 118 scoped_refptr<ServiceWorkerRegistration> existing_registration, | 119 const scoped_refptr<ServiceWorkerRegistration>& existing_registration, |
| 119 ServiceWorkerStatusCode status); | 120 ServiceWorkerStatusCode status); |
| 120 void UpdateAndContinue(); | 121 void UpdateAndContinue(); |
| 121 void OnStartWorkerFinished(ServiceWorkerStatusCode status); | 122 void OnStartWorkerFinished(ServiceWorkerStatusCode status); |
| 122 void OnStoreRegistrationComplete(ServiceWorkerStatusCode status); | 123 void OnStoreRegistrationComplete(ServiceWorkerStatusCode status); |
| 123 void InstallAndContinue(); | 124 void InstallAndContinue(); |
| 124 void DispatchInstallEvent(); | 125 void DispatchInstallEvent(); |
| 125 void OnInstallFinished(int request_id, | 126 void OnInstallFinished(int request_id, |
| 126 blink::WebServiceWorkerEventResult result, | 127 blink::WebServiceWorkerEventResult result, |
| 127 bool has_fetch_handler); | 128 bool has_fetch_handler); |
| 128 void OnInstallFailed(ServiceWorkerStatusCode status); | 129 void OnInstallFailed(ServiceWorkerStatusCode status); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 std::string promise_resolved_status_message_; | 162 std::string promise_resolved_status_message_; |
| 162 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; | 163 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; |
| 163 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; | 164 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; |
| 164 | 165 |
| 165 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); | 166 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 } // namespace content | 169 } // namespace content |
| 169 | 170 |
| 170 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | 171 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| OLD | NEW |