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

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: Response to review, fix gn build 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 {
+ 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_;
+ bool paused_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698