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

Side by Side Diff: content/browser/geolocation/geolocation_service_context.cc

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to 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 unified diff | Download patch
OLDNEW
(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 #include "content/browser/geolocation/geolocation_service_context.h"
6
7 namespace content {
8
9 GeolocationServiceContext::GeolocationServiceContext() : paused_(false) {
10 }
11
12 GeolocationServiceContext::~GeolocationServiceContext() {
13 }
14
15 void GeolocationServiceContext::CreateService(
16 const base::Closure& update_callback,
17 mojo::InterfaceRequest<GeolocationService> request) {
18 GeolocationServiceImpl* service =
19 new GeolocationServiceImpl(this, update_callback);
20 services_.push_back(service);
21 mojo::WeakBindToRequest(service, &request);
22 }
23
24 void GeolocationServiceContext::ServiceHadConnectionError(
25 GeolocationServiceImpl* service) {
26 auto it = std::find(services_.begin(), services_.end(), service);
27 DCHECK(it != services_.end());
28 services_.erase(it);
29 }
30
31 void GeolocationServiceContext::PauseUpdates() {
32 paused_ = true;
33 for (auto* service : services_) {
34 service->PauseUpdates();
35 }
36 }
37
38 void GeolocationServiceContext::ResumeUpdates() {
39 paused_ = false;
40 for (auto* service : services_) {
41 service->ResumeUpdates();
42 }
43 }
44
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698