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

Unified Diff: content/renderer/service_worker/service_worker_script_context.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/renderer/service_worker/service_worker_script_context.h
diff --git a/content/renderer/service_worker/service_worker_script_context.h b/content/renderer/service_worker/service_worker_script_context.h
index a71a2180800e0ff66a5bd1636415ccb7d112ea62..6aee37fe618ec944573318b68ee4d39685384361 100644
--- a/content/renderer/service_worker/service_worker_script_context.h
+++ b/content/renderer/service_worker/service_worker_script_context.h
@@ -22,6 +22,7 @@
#include "third_party/WebKit/public/platform/WebServiceWorkerClientFocusCallback.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
+#include "third_party/WebKit/public/platform/WebServiceWorkerSkipWaitingCallbacks.h"
namespace blink {
struct WebCircularGeofencingRegion;
@@ -71,6 +72,7 @@ class ServiceWorkerScriptContext {
scoped_ptr<blink::WebMessagePortChannelArray> channels);
void FocusClient(int client_id,
blink::WebServiceWorkerClientFocusCallback* callback);
+ void SkipWaiting(blink::WebServiceWorkerSkipWaitingCallbacks* callbacks);
// Send a message to the browser. Takes ownership of |message|.
void Send(IPC::Message* message);
@@ -88,6 +90,8 @@ class ServiceWorkerScriptContext {
ClientsCallbacksMap;
typedef IDMap<blink::WebServiceWorkerClientFocusCallback, IDMapOwnPointer>
FocusClientCallbacksMap;
+ typedef IDMap<blink::WebServiceWorkerSkipWaitingCallbacks, IDMapOwnPointer>
+ SkipWaitingCallbacksMap;
void OnActivateEvent(int request_id);
void OnInstallEvent(int request_id, int active_version_id);
@@ -108,6 +112,7 @@ class ServiceWorkerScriptContext {
void OnDidGetClientDocuments(
int request_id, const std::vector<ServiceWorkerClientInfo>& clients);
void OnFocusClientResponse(int request_id, bool result);
+ void OnDidSkipWaiting(int request_id);
scoped_ptr<ServiceWorkerCacheStorageDispatcher> cache_storage_dispatcher_;
@@ -128,6 +133,9 @@ class ServiceWorkerScriptContext {
// Pending callbacks for FocusClient().
FocusClientCallbacksMap pending_focus_client_callbacks_;
+ // Pending callbacks for SkipWaiting().
+ SkipWaitingCallbacksMap pending_skip_waiting_callbacks_;
+
// Capture timestamps for UMA
std::map<int, base::TimeTicks> activate_start_timings_;
std::map<int, base::TimeTicks> fetch_start_timings_;

Powered by Google App Engine
This is Rietveld 408576698