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

Side by Side Diff: chrome/browser/chromeos/geolocation/simple_geolocation_provider.cc

Issue 577443002: Remove implicit conversions from scoped_refptr to T* in c/b/chromeos/geolocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/geolocation/simple_geolocation_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/geolocation/simple_geolocation_provider.h" 5 #include "chrome/browser/chromeos/geolocation/simple_geolocation_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 17 matching lines...) Expand all
28 28
29 SimpleGeolocationProvider::~SimpleGeolocationProvider() { 29 SimpleGeolocationProvider::~SimpleGeolocationProvider() {
30 DCHECK(thread_checker_.CalledOnValidThread()); 30 DCHECK(thread_checker_.CalledOnValidThread());
31 } 31 }
32 32
33 void SimpleGeolocationProvider::RequestGeolocation( 33 void SimpleGeolocationProvider::RequestGeolocation(
34 base::TimeDelta timeout, 34 base::TimeDelta timeout,
35 SimpleGeolocationRequest::ResponseCallback callback) { 35 SimpleGeolocationRequest::ResponseCallback callback) {
36 DCHECK(thread_checker_.CalledOnValidThread()); 36 DCHECK(thread_checker_.CalledOnValidThread());
37 SimpleGeolocationRequest* request( 37 SimpleGeolocationRequest* request(
38 new SimpleGeolocationRequest(url_context_getter_, url_, timeout)); 38 new SimpleGeolocationRequest(url_context_getter_.get(), url_, timeout));
39 requests_.push_back(request); 39 requests_.push_back(request);
40 40
41 // SimpleGeolocationProvider owns all requests. It is safe to pass unretained 41 // SimpleGeolocationProvider owns all requests. It is safe to pass unretained
42 // "this" because destruction of SimpleGeolocationProvider cancels all 42 // "this" because destruction of SimpleGeolocationProvider cancels all
43 // requests. 43 // requests.
44 SimpleGeolocationRequest::ResponseCallback callback_tmp( 44 SimpleGeolocationRequest::ResponseCallback callback_tmp(
45 base::Bind(&SimpleGeolocationProvider::OnGeolocationResponse, 45 base::Bind(&SimpleGeolocationProvider::OnGeolocationResponse,
46 base::Unretained(this), 46 base::Unretained(this),
47 request, 47 request,
48 callback)); 48 callback));
(...skipping 15 matching lines...) Expand all
64 64
65 callback.Run(geoposition, server_error, elapsed); 65 callback.Run(geoposition, server_error, elapsed);
66 66
67 ScopedVector<SimpleGeolocationRequest>::iterator new_end = 67 ScopedVector<SimpleGeolocationRequest>::iterator new_end =
68 std::remove(requests_.begin(), requests_.end(), request); 68 std::remove(requests_.begin(), requests_.end(), request);
69 DCHECK_EQ(std::distance(new_end, requests_.end()), 1); 69 DCHECK_EQ(std::distance(new_end, requests_.end()), 1);
70 requests_.erase(new_end, requests_.end()); 70 requests_.erase(new_end, requests_.end());
71 } 71 }
72 72
73 } // namespace chromeos 73 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/geolocation/simple_geolocation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698