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

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

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/network_location_request.h" 5 #include "content/browser/geolocation/network_location_request.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 RecordUmaAccessPoints(wifi_data.access_point_data.size()); 116 RecordUmaAccessPoints(wifi_data.access_point_data.size());
117 if (url_fetcher_ != NULL) { 117 if (url_fetcher_ != NULL) {
118 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request"; 118 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request";
119 RecordUmaEvent(NETWORK_LOCATION_REQUEST_EVENT_REQUEST_CANCEL); 119 RecordUmaEvent(NETWORK_LOCATION_REQUEST_EVENT_REQUEST_CANCEL);
120 url_fetcher_.reset(); 120 url_fetcher_.reset();
121 } 121 }
122 wifi_data_ = wifi_data; 122 wifi_data_ = wifi_data;
123 wifi_data_timestamp_ = timestamp; 123 wifi_data_timestamp_ = timestamp;
124 124
125 GURL request_url = FormRequestURL(url_); 125 GURL request_url = FormRequestURL(url_);
126 url_fetcher_.reset(net::URLFetcher::Create( 126 url_fetcher_ = net::URLFetcher::Create(url_fetcher_id_for_tests, request_url,
127 url_fetcher_id_for_tests, request_url, net::URLFetcher::POST, this)); 127 net::URLFetcher::POST, this);
128 url_fetcher_->SetRequestContext(url_context_.get()); 128 url_fetcher_->SetRequestContext(url_context_.get());
129 std::string upload_data; 129 std::string upload_data;
130 FormUploadData(wifi_data, timestamp, access_token, &upload_data); 130 FormUploadData(wifi_data, timestamp, access_token, &upload_data);
131 url_fetcher_->SetUploadData("application/json", upload_data); 131 url_fetcher_->SetUploadData("application/json", upload_data);
132 url_fetcher_->SetLoadFlags( 132 url_fetcher_->SetLoadFlags(
133 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | 133 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE |
134 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES | 134 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES |
135 net::LOAD_DO_NOT_SEND_AUTH_DATA); 135 net::LOAD_DO_NOT_SEND_AUTH_DATA);
136 136
137 request_start_time_ = base::TimeTicks::Now(); 137 request_start_time_ = base::TimeTicks::Now();
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 // Other fields are optional. 424 // Other fields are optional.
425 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); 425 GetAsDouble(*response_object, kAccuracyString, &position->accuracy);
426 426
427 return true; 427 return true;
428 } 428 }
429 429
430 } // namespace 430 } // namespace
431 431
432 } // namespace content 432 } // namespace content
OLDNEW
« no previous file with comments | « components/web_resource/web_resource_service.cc ('k') | content/browser/speech/google_one_shot_remote_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698