diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 11:31:00 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 11:31:00 +0000 |
commit | 1642c6086d35b6767c07eca51d23af8ca6d4f3b7 (patch) | |
tree | ce445b2f39cb80f159f4f99e6977851df0bb6cf2 /chrome/browser/geolocation/network_location_request.h | |
parent | 25212c49c8dff853bb05e52ed4629a8c659004a5 (diff) | |
download | chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.zip chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.tar.gz chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.tar.bz2 |
Defer sending wifi data via the network provider until permission has been granted to use geolocaiton.
Also fixes a long standing todos/bugs that the host sent in the network request was not set correctly, and
location results were not always tagged against the correct source data in the cache.
BUG=39171
TEST=run with --geolocation-enabled and --log-level=0, check from logs that no location request sent until authorized.
Review URL: http://codereview.chromium.org/1541008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43339 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation/network_location_request.h')
-rw-r--r-- | chrome/browser/geolocation/network_location_request.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/geolocation/network_location_request.h b/chrome/browser/geolocation/network_location_request.h index 7f1b399..e08d570 100644 --- a/chrome/browser/geolocation/network_location_request.h +++ b/chrome/browser/geolocation/network_location_request.h @@ -31,24 +31,24 @@ class NetworkLocationRequest : private URLFetcher::Delegate { virtual void LocationResponseAvailable( const Geoposition& position, bool server_error, - const string16& access_token) = 0; + const string16& access_token, + const RadioData& radio_data, + const WifiData& wifi_data) = 0; protected: virtual ~ListenerInterface() {} }; - // |url| is the server address to which the request wil be sent, |host_name| - // is the host of the webpage that caused this request. - // TODO(joth): is host needed? What to do when we reuse cached locations? + // |url| is the server address to which the request wil be sent. NetworkLocationRequest(URLRequestContextGetter* context, const GURL& url, - const string16& host_name, ListenerInterface* listener); virtual ~NetworkLocationRequest(); // Makes a new request. Returns true if the new request was successfully // started. In all cases, any currently pending request will be canceled. - bool MakeRequest(const string16& access_token, + bool MakeRequest(const std::string& host, + const string16& access_token, const RadioData& radio_data, const WifiData& wifi_data, const base::Time& timestamp); @@ -66,12 +66,16 @@ class NetworkLocationRequest : private URLFetcher::Delegate { const std::string& data); scoped_refptr<URLRequestContextGetter> url_context_; - base::Time timestamp_; // The timestamp of the data used to make the request. ListenerInterface* listener_; const GURL url_; - string16 host_name_; scoped_ptr<URLFetcher> url_fetcher_; + // Keep a copy of the data sent in the request, so we can refer back to it + // when the response arrives. + RadioData radio_data_; + WifiData wifi_data_; + base::Time timestamp_; // Timestamp of the above data, not of the request. + DISALLOW_EVIL_CONSTRUCTORS(NetworkLocationRequest); }; |