Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ | |
| 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 | |
| 10 namespace content { | |
| 11 class GeolocationServiceImpl; | |
| 12 | |
| 13 // Provides information to a set of GeolocationServiceImpl instances that are | |
| 14 // associated with a given context. Notably, allows pausing and resuming | |
| 15 // geolocation on these instances. | |
| 16 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.
| |
| 17 public: | |
| 18 GeolocationServiceImplContext(); | |
| 19 virtual ~GeolocationServiceImplContext(); | |
| 20 | |
| 21 // Adds and removes a service to this context. | |
| 22 void AddService(GeolocationServiceImpl* service); | |
| 23 void RemoveService(GeolocationServiceImpl* service); | |
| 24 | |
| 25 // Pauses and resumes geolocation. Resuming when nothing is paused is a | |
| 26 // no-op. If a service is added while geolocation is paused, that service | |
| 27 // will not get geolocation updates until geolocation is resumed. | |
| 28 void PauseUpdates(); | |
| 29 void ResumeUpdates(); | |
| 30 | |
| 31 // Returns whether geolocation updates are currently paused. | |
| 32 bool paused() { return paused_; } | |
| 33 | |
| 34 private: | |
| 35 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.
| |
| 36 bool paused_; | |
| 37 }; | |
|
Michael van Ouwerkerk
2014/10/08 14:13:08
Does this need DISALLOW_COPY_AND_ASSIGN?
blundell
2014/10/09 08:32:52
Done.
| |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_CONTEXT_H_ | |
| OLD | NEW |