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

Unified Diff: content/browser/geolocation/geolocation_service_impl_context.h

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle WebContents going away 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/geolocation/geolocation_service_impl_context.h
diff --git a/content/browser/geolocation/geolocation_service_impl_context.h b/content/browser/geolocation/geolocation_service_impl_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..9b0c855ef66cade8c28ae470b80d3208a6e46d3d
--- /dev/null
+++ b/content/browser/geolocation/geolocation_service_impl_context.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_
+#define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_
+
+#include <list>
+
+namespace content {
+class GeolocationServiceImpl;
+
+// Provides information to a set of GeolocationServiceImpl instances that are
+// associated with a given context. Notably, allows pausing and resuming
+// geolocation on these instances.
+class GeolocationServiceImplContext {
Michael van Ouwerkerk 2014/10/08 14:13:08 Would it be ok to just call this GeolocationServic
blundell 2014/10/09 08:32:52 Done.
+ public:
+ GeolocationServiceImplContext();
+ virtual ~GeolocationServiceImplContext();
+
+ // Adds and removes a service to this context.
+ void AddService(GeolocationServiceImpl* service);
+ void RemoveService(GeolocationServiceImpl* service);
+
+ // Pauses and resumes geolocation. Resuming when nothing is paused is a
+ // no-op. If a service is added while geolocation is paused, that service
+ // will not get geolocation updates until geolocation is resumed.
+ void PauseUpdates();
+ void ResumeUpdates();
+
+ // Returns whether geolocation updates are currently paused.
+ bool paused() { return paused_; }
+
+ private:
+ std::list<GeolocationServiceImpl*> attached_services_;
Michael van Ouwerkerk 2014/10/08 14:13:08 Nit: just 'services_' seems sufficient.
Michael van Ouwerkerk 2014/10/08 14:13:08 As these are raw pointers, can you document who ow
blundell 2014/10/09 08:32:52 I changed the ownership model so that this class o
blundell 2014/10/09 08:32:52 Done.
+ bool paused_;
+};
Michael van Ouwerkerk 2014/10/08 14:13:08 Does this need DISALLOW_COPY_AND_ASSIGN?
blundell 2014/10/09 08:32:52 Done.
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698