OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (url_fetcher_ != NULL) { | 85 if (url_fetcher_ != NULL) { |
86 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request"; | 86 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request"; |
87 url_fetcher_.reset(); | 87 url_fetcher_.reset(); |
88 } | 88 } |
89 wifi_data_ = wifi_data; | 89 wifi_data_ = wifi_data; |
90 timestamp_ = timestamp; | 90 timestamp_ = timestamp; |
91 | 91 |
92 GURL request_url = FormRequestURL(url_); | 92 GURL request_url = FormRequestURL(url_); |
93 url_fetcher_.reset(net::URLFetcher::Create( | 93 url_fetcher_.reset(net::URLFetcher::Create( |
94 url_fetcher_id_for_tests, request_url, net::URLFetcher::POST, this)); | 94 url_fetcher_id_for_tests, request_url, net::URLFetcher::POST, this)); |
95 url_fetcher_->SetRequestContext(url_context_); | 95 url_fetcher_->SetRequestContext(url_context_.get()); |
96 std::string upload_data; | 96 std::string upload_data; |
97 FormUploadData(wifi_data, timestamp, access_token, &upload_data); | 97 FormUploadData(wifi_data, timestamp, access_token, &upload_data); |
98 url_fetcher_->SetUploadData("application/json", upload_data); | 98 url_fetcher_->SetUploadData("application/json", upload_data); |
99 url_fetcher_->SetLoadFlags( | 99 url_fetcher_->SetLoadFlags( |
100 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | | 100 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | |
101 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES | | 101 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES | |
102 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 102 net::LOAD_DO_NOT_SEND_AUTH_DATA); |
103 | 103 |
104 start_time_ = base::TimeTicks::Now(); | 104 start_time_ = base::TimeTicks::Now(); |
105 url_fetcher_->Start(); | 105 url_fetcher_->Start(); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 // Other fields are optional. | 384 // Other fields are optional. |
385 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); | 385 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); |
386 | 386 |
387 return true; | 387 return true; |
388 } | 388 } |
389 | 389 |
390 } // namespace | 390 } // namespace |
391 | 391 |
392 } // namespace content | 392 } // namespace content |
OLD | NEW |