summaryrefslogtreecommitdiffstats
path: root/content/browser/geolocation/access_token_store.h
diff options
context:
space:
mode:
authorallanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 11:00:41 +0000
committerallanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 11:00:41 +0000
commit60349d9e37ccb786e4464a5081cdcefb8ebc1543 (patch)
tree62c76ee9601b2f356ef000aa2247eada5168864d /content/browser/geolocation/access_token_store.h
parent2767e906eb2a3cd95584702d7a207352e59b4cc4 (diff)
downloadchromium_src-60349d9e37ccb786e4464a5081cdcefb8ebc1543.zip
chromium_src-60349d9e37ccb786e4464a5081cdcefb8ebc1543.tar.gz
chromium_src-60349d9e37ccb786e4464a5081cdcefb8ebc1543.tar.bz2
Remove use of GetDefaultRequestContext in geolocation.
Now uses the ChromeAccessTokenStore to get us a system request context from within the chrome/ directory. Also access tokens and the context getter are reloaded each time GeolocationArbitrator::StartProviders is called if providers have not already been started. BUG=92363 TEST= Review URL: http://codereview.chromium.org/7809020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/geolocation/access_token_store.h')
-rw-r--r--content/browser/geolocation/access_token_store.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/content/browser/geolocation/access_token_store.h b/content/browser/geolocation/access_token_store.h
index 87ad577..df3ec61 100644
--- a/content/browser/geolocation/access_token_store.h
+++ b/content/browser/geolocation/access_token_store.h
@@ -24,6 +24,10 @@
class GURL;
+namespace net {
+class URLRequestContextGetter;
+}
+
// Provides storage for the access token used in the network request.
class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>,
public CancelableRequestProvider {
@@ -31,9 +35,14 @@ class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>,
// Map of server URLs to associated access token.
typedef std::map<GURL, string16> AccessTokenSet;
- typedef Callback1<AccessTokenSet>::Type LoadAccessTokensCallbackType;
- // callback will be invoked once, after existing access tokens have
- // been loaded from persistent store. Takes ownership of callback.
+ typedef Callback2<AccessTokenSet, net::URLRequestContextGetter*>::Type
+ LoadAccessTokensCallbackType;
+ // |callback| will be invoked once per LoadAccessTokens call, after existing
+ // access tokens have been loaded from persistent store. As a convenience the
+ // URLRequestContextGetter is also supplied as an argument in |callback|, as
+ // in Chrome the call to obtain this must also be performed on the UI thread
+ // so it is efficient to piggyback it onto this request.
+ // Takes ownership of |callback|.
// Returns a handle which can subsequently be used with CancelRequest().
Handle LoadAccessTokens(CancelableRequestConsumerBase* consumer,
LoadAccessTokensCallbackType* callback);