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

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

Issue 645763003: Refactor GeofencingManager to have one instance per StoragePartition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 077485b38f6a31407c7dc2400408c09bce9bcd31..f2fe54a85bfda28e4714dcb9f663f0362662ef26 100644
--- a/content/browser/geofencing/geofencing_dispatcher_host.cc
+++ b/content/browser/geofencing/geofencing_dispatcher_host.cc
@@ -7,16 +7,15 @@
#include "content/browser/geofencing/geofencing_manager.h"
#include "content/common/geofencing_messages.h"
#include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h"
-#include "url/gurl.h"
namespace content {
static const int kMaxRegionIdLength = 200;
GeofencingDispatcherHost::GeofencingDispatcherHost(
- BrowserContext* browser_context)
+ GeofencingManager* geofencing_manager)
: BrowserMessageFilter(GeofencingMsgStart),
- browser_context_(browser_context),
+ manager_(geofencing_manager),
weak_factory_(this) {
}
@@ -47,10 +46,8 @@ void GeofencingDispatcherHost::OnRegisterRegion(
return;
}
// TODO(mek): Actually pass service worker information to manager.
- GeofencingManager::GetInstance()->RegisterRegion(
- browser_context_,
- 0, /* service_worker_registration_id */
- GURL(), /* service_worker_origin */
+ manager_->RegisterRegion(
+ 0, /* service_worker_registration_id */
region_id,
region,
base::Bind(&GeofencingDispatcherHost::RegisterRegionCompleted,
@@ -70,10 +67,8 @@ void GeofencingDispatcherHost::OnUnregisterRegion(
return;
}
// TODO(mek): Actually pass service worker information to manager.
- GeofencingManager::GetInstance()->UnregisterRegion(
- browser_context_,
- 0, /* service_worker_registration_id */
- GURL(), /* service_worker_origin */
+ manager_->UnregisterRegion(
+ 0, /* service_worker_registration_id */
region_id,
base::Bind(&GeofencingDispatcherHost::UnregisterRegionCompleted,
weak_factory_.GetWeakPtr(),
@@ -86,11 +81,8 @@ void GeofencingDispatcherHost::OnGetRegisteredRegions(int thread_id,
GeofencingRegistrations result;
// TODO(mek): Actually pass service worker information to manager.
GeofencingStatus status =
- GeofencingManager::GetInstance()->GetRegisteredRegions(
- browser_context_,
- 0, /* service_worker_registration_id */
- GURL(), /* service_worker_origin */
- &result);
+ manager_->GetRegisteredRegions(0, /* 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