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

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 717353004: ServiceWorker: Add support for .skipWaiting and controllerchange event(2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index ef4132003959cd729ed9be4affca836e639d6986..e75c12f819941610e101ca8769a2a1937cfc5fea 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -251,6 +251,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
void Doom();
bool is_doomed() const { return is_doomed_; }
+ bool skip_waiting() const { return skip_waiting_; }
+
private:
class GetClientDocumentsCallback;
class GetClientInfoCallback;
@@ -312,8 +314,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
const base::string16& message,
const std::vector<int>& sent_message_port_ids);
void OnFocusClient(int request_id, int client_id);
+ void OnSkipWaiting(int request_id);
void OnFocusClientFinished(int request_id, bool result);
+ void DidSkipWaiting(int request_id);
void ScheduleStopWorker();
void DoomInternal();
@@ -346,6 +350,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_;
base::OneShotTimer<ServiceWorkerVersion> update_timer_;
bool is_doomed_;
+ std::vector<int> pending_skip_waiting_requests_;
+ bool skip_waiting_;
base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698