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

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

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review 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.cc
diff --git a/content/browser/geolocation/geolocation_service_impl_context.cc b/content/browser/geolocation/geolocation_service_impl_context.cc
new file mode 100644
index 0000000000000000000000000000000000000000..28df260accf8c78151d770e3e42e993b8d69e6a2
--- /dev/null
+++ b/content/browser/geolocation/geolocation_service_impl_context.cc
@@ -0,0 +1,42 @@
+// 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.
+
+#include "content/browser/geolocation/geolocation_service_impl_context.h"
+
+#include "content/browser/geolocation/geolocation_service_impl.h"
+
+namespace content {
+
+GeolocationServiceImplContext::GeolocationServiceImplContext()
+ : paused_(false) {
+}
+
+GeolocationServiceImplContext::~GeolocationServiceImplContext() {
+}
+
+void GeolocationServiceImplContext::AddService(
+ GeolocationServiceImpl* service) {
+ attached_services_.push_back(service);
+}
+
+void GeolocationServiceImplContext::RemoveService(
+ GeolocationServiceImpl* service) {
+ attached_services_.remove(service);
+}
+
+void GeolocationServiceImplContext::PauseUpdates() {
+ paused_ = true;
+ for (auto service : attached_services_) {
qsr 2014/10/07 13:03:58 You should be using auto* to make it clear that th
blundell 2014/10/07 14:35:24 Done.
+ service->PauseUpdates();
+ }
+}
+
+void GeolocationServiceImplContext::ResumeUpdates() {
+ paused_ = false;
+ for (auto service : attached_services_) {
+ service->ResumeUpdates();
+ }
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698