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

Side by Side Diff: device/geolocation/geolocation_service_impl.cc

Issue 2608513002: Remove mojo::String. (Closed)
Patch Set: rebase Created 3 years, 11 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/geolocation/geolocation_service_impl.h" 5 #include "device/geolocation/geolocation_service_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 binding_.set_connection_error_handler(base::Bind( 71 binding_.set_connection_error_handler(base::Bind(
72 &GeolocationServiceImpl::OnConnectionError, base::Unretained(this))); 72 &GeolocationServiceImpl::OnConnectionError, base::Unretained(this)));
73 } 73 }
74 74
75 GeolocationServiceImpl::~GeolocationServiceImpl() { 75 GeolocationServiceImpl::~GeolocationServiceImpl() {
76 // Make sure to respond to any pending callback even without a valid position. 76 // Make sure to respond to any pending callback even without a valid position.
77 if (!position_callback_.is_null()) { 77 if (!position_callback_.is_null()) {
78 if (!current_position_.valid) { 78 if (!current_position_.valid) {
79 current_position_.error_code = mojom::Geoposition::ErrorCode( 79 current_position_.error_code = mojom::Geoposition::ErrorCode(
80 GEOPOSITION_ERROR_CODE_POSITION_UNAVAILABLE); 80 GEOPOSITION_ERROR_CODE_POSITION_UNAVAILABLE);
81 current_position_.error_message = mojo::String(""); 81 current_position_.error_message.clear();
82 } 82 }
83 ReportCurrentPosition(); 83 ReportCurrentPosition();
84 } 84 }
85 } 85 }
86 86
87 void GeolocationServiceImpl::PauseUpdates() { 87 void GeolocationServiceImpl::PauseUpdates() {
88 geolocation_subscription_.reset(); 88 geolocation_subscription_.reset();
89 } 89 }
90 90
91 void GeolocationServiceImpl::ResumeUpdates() { 91 void GeolocationServiceImpl::ResumeUpdates() {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 ReportCurrentPosition(); 181 ReportCurrentPosition();
182 } 182 }
183 183
184 void GeolocationServiceImpl::ReportCurrentPosition() { 184 void GeolocationServiceImpl::ReportCurrentPosition() {
185 position_callback_.Run(current_position_.Clone()); 185 position_callback_.Run(current_position_.Clone());
186 position_callback_.Reset(); 186 position_callback_.Reset();
187 has_position_to_report_ = false; 187 has_position_to_report_ = false;
188 } 188 }
189 189
190 } // namespace device 190 } // namespace device
OLDNEW
« no previous file with comments | « content/common/service_manager/service_manager_connection_impl.h ('k') | device/serial/serial_device_enumerator_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698