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

Unified Diff: content/browser/geofencing/geofencing_dispatcher_host.cc

Issue 623823002: Chrome side of passing on the service worker registration with geofencing API calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/geofencing/geofencing_dispatcher_host.cc
diff --git a/content/browser/geofencing/geofencing_dispatcher_host.cc b/content/browser/geofencing/geofencing_dispatcher_host.cc
index f2fe54a85bfda28e4714dcb9f663f0362662ef26..5cae1136bc98afa4b8ae41cf5b22c2669524781d 100644
--- a/content/browser/geofencing/geofencing_dispatcher_host.cc
+++ b/content/browser/geofencing/geofencing_dispatcher_host.cc
@@ -5,6 +5,9 @@
#include "content/browser/geofencing/geofencing_dispatcher_host.h"
#include "content/browser/geofencing/geofencing_manager.h"
+#include "content/browser/service_worker/service_worker_context_core.h"
+#include "content/browser/service_worker/service_worker_context_wrapper.h"
+#include "content/browser/service_worker/service_worker_registration.h"
#include "content/common/geofencing_messages.h"
#include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h"
@@ -38,16 +41,17 @@ void GeofencingDispatcherHost::OnRegisterRegion(
int thread_id,
int request_id,
const std::string& region_id,
- const blink::WebCircularGeofencingRegion& region) {
+ const blink::WebCircularGeofencingRegion& region,
+ int64 service_worker_registration_id) {
// Sanity check on region_id
if (region_id.length() > kMaxRegionIdLength) {
Send(new GeofencingMsg_RegisterRegionComplete(
thread_id, request_id, GeofencingStatus::GEOFENCING_STATUS_ERROR));
return;
}
- // TODO(mek): Actually pass service worker information to manager.
+
manager_->RegisterRegion(
- 0, /* service_worker_registration_id */
+ service_worker_registration_id,
region_id,
region,
base::Bind(&GeofencingDispatcherHost::RegisterRegionCompleted,
@@ -59,16 +63,17 @@ void GeofencingDispatcherHost::OnRegisterRegion(
void GeofencingDispatcherHost::OnUnregisterRegion(
int thread_id,
int request_id,
- const std::string& region_id) {
+ const std::string& region_id,
+ int64 service_worker_registration_id) {
// Sanity check on region_id
if (region_id.length() > kMaxRegionIdLength) {
Send(new GeofencingMsg_UnregisterRegionComplete(
thread_id, request_id, GeofencingStatus::GEOFENCING_STATUS_ERROR));
return;
}
- // TODO(mek): Actually pass service worker information to manager.
+
manager_->UnregisterRegion(
- 0, /* service_worker_registration_id */
+ service_worker_registration_id,
region_id,
base::Bind(&GeofencingDispatcherHost::UnregisterRegionCompleted,
weak_factory_.GetWeakPtr(),
@@ -76,13 +81,14 @@ void GeofencingDispatcherHost::OnUnregisterRegion(
request_id));
}
-void GeofencingDispatcherHost::OnGetRegisteredRegions(int thread_id,
- int request_id) {
+void GeofencingDispatcherHost::OnGetRegisteredRegions(
+ int thread_id,
+ int request_id,
+ int64 service_worker_registration_id) {
GeofencingRegistrations result;
- // TODO(mek): Actually pass service worker information to manager.
+
GeofencingStatus status =
- manager_->GetRegisteredRegions(0, /* service_worker_registration_id */
- &result);
+ manager_->GetRegisteredRegions(service_worker_registration_id, &result);
Send(new GeofencingMsg_GetRegisteredRegionsComplete(
thread_id, request_id, status, result));
}
« no previous file with comments | « content/browser/geofencing/geofencing_dispatcher_host.h ('k') | content/browser/geofencing/geofencing_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698