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

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

Issue 629393002: Chromium side of geofencing event dispatching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geofencing_serviceworker
Patch Set: Created 6 years, 2 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 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 9d0b34235f22edee8d6260a63df88d3164c2dff9..3ab5536ca051008ff903d974bd92493acfcd9d43 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -23,10 +23,15 @@
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_status_code.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
class GURL;
+namespace blink {
+struct WebCircularGeofencingRegion;
+}
+
namespace content {
class EmbeddedWorkerRegistry;
@@ -197,6 +202,17 @@ class CONTENT_EXPORT ServiceWorkerVersion
void DispatchPushEvent(const StatusCallback& callback,
const std::string& data);
+ // Sends geofencing event to the associated embedded woker and asynchronously
dominicc (has gone to gerrit) 2014/10/07 01:52:05 nit: woker
Marijn Kruisselbrink 2014/10/09 22:56:56 Done.
+ // calls |callback| when it errors out or it gets response from the worker to
dominicc (has gone to gerrit) 2014/10/07 01:52:05 nit: response needs an article--a, the
Marijn Kruisselbrink 2014/10/09 22:56:56 Done. (and also fixed this in all the other places
+ // notify completion.
+ //
+ // This must be called when the status() is ACTIVATED.
+ void DispatchGeofencingEvent(
+ const StatusCallback& callback,
+ blink::WebGeofencingEventType event_type,
+ const std::string& region_id,
+ const blink::WebCircularGeofencingRegion& region);
+
// Adds and removes |provider_host| as a controllee of this ServiceWorker.
// A potential controllee is a host having the version as its .installing
// or .waiting version.
@@ -261,6 +277,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
const ServiceWorkerResponse& response);
void OnSyncEventFinished(int request_id);
void OnPushEventFinished(int request_id);
+ void OnGeofencingEventFinished(int request_id);
void OnPostMessageToDocument(int client_id,
const base::string16& message,
const std::vector<int>& sent_message_port_ids);
@@ -285,6 +302,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_;
IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_;
IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_;
+ IDMap<StatusCallback, IDMapOwnPointer> geofencing_callbacks_;
ControlleeMap controllee_map_;
ControlleeByIDMap controllee_by_id_;

Powered by Google App Engine
This is Rietveld 408576698