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

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

Issue 493373002: ServiceWorker: Add prepare_callback in DispatchFetchEvent to notify the end of SW preparation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the test failure and rebase Created 6 years, 3 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
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_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Upon completion, the version's status will be changed to ACTIVATED 174 // Upon completion, the version's status will be changed to ACTIVATED
175 // on success, or back to INSTALLED on failure. 175 // on success, or back to INSTALLED on failure.
176 void DispatchActivateEvent(const StatusCallback& callback); 176 void DispatchActivateEvent(const StatusCallback& callback);
177 177
178 // Sends fetch event to the associated embedded worker and calls 178 // Sends fetch event to the associated embedded worker and calls
179 // |callback| with the response from the worker. 179 // |callback| with the response from the worker.
180 // 180 //
181 // This must be called when the status() is ACTIVATED. Calling this in other 181 // This must be called when the status() is ACTIVATED. Calling this in other
182 // statuses will result in an error SERVICE_WORKER_ERROR_FAILED. 182 // statuses will result in an error SERVICE_WORKER_ERROR_FAILED.
183 void DispatchFetchEvent(const ServiceWorkerFetchRequest& request, 183 void DispatchFetchEvent(const ServiceWorkerFetchRequest& request,
184 const FetchCallback& callback); 184 const base::Closure& prepare_callback,
185 const FetchCallback& fetch_callback);
185 186
186 // Sends sync event to the associated embedded worker and asynchronously calls 187 // Sends sync event to the associated embedded worker and asynchronously calls
187 // |callback| when it errors out or it gets response from the worker to notify 188 // |callback| when it errors out or it gets response from the worker to notify
188 // completion. 189 // completion.
189 // 190 //
190 // This must be called when the status() is ACTIVATED. 191 // This must be called when the status() is ACTIVATED.
191 void DispatchSyncEvent(const StatusCallback& callback); 192 void DispatchSyncEvent(const StatusCallback& callback);
192 193
193 // Sends push event to the associated embedded worker and asynchronously calls 194 // Sends push event to the associated embedded worker and asynchronously calls
194 // |callback| when it errors out or it gets response from the worker to notify 195 // |callback| when it errors out or it gets response from the worker to notify
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 bool is_doomed_; 309 bool is_doomed_;
309 310
310 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 311 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
311 312
312 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 313 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
313 }; 314 };
314 315
315 } // namespace content 316 } // namespace content
316 317
317 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 318 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698