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

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: add missing '!' Created 6 years, 1 month 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 f98250d04b1c07fd3a5e9ef8ed70955b0f0b3e76..aff07e6049da7ea2893520858d490dec03e479b3 100644
--- a/content/renderer/service_worker/service_worker_script_context.h
+++ b/content/renderer/service_worker/service_worker_script_context.h
@@ -17,6 +17,7 @@
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/renderer/service_worker/service_worker_cache_storage_dispatcher.h"
+#include "third_party/WebKit/public/platform/WebCallback.h"
#include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
#include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h"
@@ -62,6 +63,7 @@ class ServiceWorkerScriptContext {
int client_id,
const base::string16& message,
scoped_ptr<blink::WebMessagePortChannelArray> channels);
+ void SkipWaiting(blink::WebCallback* callback);
// Send a message to the browser. Takes ownership of |message|.
void Send(IPC::Message* message);
@@ -77,7 +79,7 @@ class ServiceWorkerScriptContext {
private:
typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer>
ClientsCallbacksMap;
-
+ typedef IDMap<blink::WebCallback, IDMapOwnPointer> SkipWaitingCallbacksMap;
void OnActivateEvent(int request_id);
void OnInstallEvent(int request_id, int active_version_id);
@@ -93,6 +95,7 @@ class ServiceWorkerScriptContext {
const std::vector<int>& new_routing_ids);
void OnDidGetClientDocuments(
int request_id, const std::vector<int>& client_ids);
+ void OnDidSkipWaiting(int request_id);
scoped_ptr<ServiceWorkerCacheStorageDispatcher> cache_storage_dispatcher_;
@@ -110,6 +113,9 @@ class ServiceWorkerScriptContext {
// Pending callbacks for GetClientDocuments().
ClientsCallbacksMap pending_clients_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