Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: content/browser/service_worker/service_worker_register_job.h

Issue 369063004: ServiceWorker: SWRegisterJob should manage status of SWVersion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void CompleteInternal(ServiceWorkerStatusCode status); 111 void CompleteInternal(ServiceWorkerStatusCode status);
112 112
113 void ResolvePromise(ServiceWorkerStatusCode status, 113 void ResolvePromise(ServiceWorkerStatusCode status,
114 ServiceWorkerRegistration* registration, 114 ServiceWorkerRegistration* registration,
115 ServiceWorkerVersion* version); 115 ServiceWorkerVersion* version);
116 116
117 // EmbeddedWorkerInstance::Listener override of OnPausedAfterDownload. 117 // EmbeddedWorkerInstance::Listener override of OnPausedAfterDownload.
118 virtual void OnPausedAfterDownload() OVERRIDE; 118 virtual void OnPausedAfterDownload() OVERRIDE;
119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
120 120
121 // Associates an installing version to documents matched with a scope of the
122 // version.
123 CONTENT_EXPORT static void AssociateInstallingVersionToDocuments(
124 base::WeakPtr<ServiceWorkerContextCore> context,
125 ServiceWorkerVersion* version);
126
121 // Associates a waiting version to documents matched with a scope of the 127 // Associates a waiting version to documents matched with a scope of the
122 // version. 128 // version.
123 CONTENT_EXPORT static void AssociateInstallingVersionToDocuments( 129 CONTENT_EXPORT static void AssociateWaitingVersionToDocuments(
124 base::WeakPtr<ServiceWorkerContextCore> context, 130 base::WeakPtr<ServiceWorkerContextCore> context,
125 ServiceWorkerVersion* version); 131 ServiceWorkerVersion* version);
126 132
127 // Disassociates a version specified by |version_id| from documents. 133 // Disassociates a version specified by |version_id| from documents.
128 CONTENT_EXPORT static void DisassociateVersionFromDocuments( 134 CONTENT_EXPORT static void DisassociateVersionFromDocuments(
129 base::WeakPtr<ServiceWorkerContextCore> context, 135 base::WeakPtr<ServiceWorkerContextCore> context,
130 ServiceWorkerVersion* version); 136 ServiceWorkerVersion* version);
131 137
132 // The ServiceWorkerContextCore object should always outlive this. 138 // The ServiceWorkerContextCore object should always outlive this.
133 base::WeakPtr<ServiceWorkerContextCore> context_; 139 base::WeakPtr<ServiceWorkerContextCore> context_;
134 140
135 const GURL pattern_; 141 const GURL pattern_;
136 const GURL script_url_; 142 const GURL script_url_;
137 std::vector<RegistrationCallback> callbacks_; 143 std::vector<RegistrationCallback> callbacks_;
138 std::vector<int> pending_process_ids_; 144 std::vector<int> pending_process_ids_;
139 Phase phase_; 145 Phase phase_;
140 Internal internal_; 146 Internal internal_;
141 bool is_promise_resolved_; 147 bool is_promise_resolved_;
142 ServiceWorkerStatusCode promise_resolved_status_; 148 ServiceWorkerStatusCode promise_resolved_status_;
143 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; 149 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_;
144 scoped_refptr<ServiceWorkerVersion> promise_resolved_version_; 150 scoped_refptr<ServiceWorkerVersion> promise_resolved_version_;
145 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; 151 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_;
146 152
147 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); 153 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob);
148 }; 154 };
149 155
150 } // namespace content 156 } // namespace content
151 157
152 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ 158 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698