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

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

Issue 2080083002: Revert of Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "content/browser/geolocation/geolocation_service_impl.h" 5 #include "content/browser/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.h" 10 #include "base/metrics/histogram.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 if (position_override_.Validate()) { 116 if (position_override_.Validate()) {
117 OnLocationUpdate(position_override_); 117 OnLocationUpdate(position_override_);
118 return; 118 return;
119 } 119 }
120 120
121 StartListeningForUpdates(); 121 StartListeningForUpdates();
122 } 122 }
123 123
124 void GeolocationServiceImpl::QueryNextPosition( 124 void GeolocationServiceImpl::QueryNextPosition(
125 const QueryNextPositionCallback& callback) { 125 const PositionCallback& callback) {
126 if (!position_callback_.is_null()) { 126 if (!position_callback_.is_null()) {
127 DVLOG(1) << "Overlapped call to QueryNextPosition!"; 127 DVLOG(1) << "Overlapped call to QueryNextPosition!";
128 OnConnectionError(); // Simulate a connection error. 128 OnConnectionError(); // Simulate a connection error.
129 return; 129 return;
130 } 130 }
131 131
132 position_callback_ = callback; 132 position_callback_ = callback;
133 133
134 if (has_position_to_report_) 134 if (has_position_to_report_)
135 ReportCurrentPosition(); 135 ReportCurrentPosition();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ReportCurrentPosition(); 186 ReportCurrentPosition();
187 } 187 }
188 188
189 void GeolocationServiceImpl::ReportCurrentPosition() { 189 void GeolocationServiceImpl::ReportCurrentPosition() {
190 position_callback_.Run(current_position_.Clone()); 190 position_callback_.Run(current_position_.Clone());
191 position_callback_.Reset(); 191 position_callback_.Reset();
192 has_position_to_report_ = false; 192 has_position_to_report_ = false;
193 } 193 }
194 194
195 } // namespace content 195 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/geolocation_service_impl.h ('k') | content/browser/media/capture/image_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698