summaryrefslogtreecommitdiffstats
path: root/content/browser/geolocation
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/geolocation')
-rw-r--r--content/browser/geolocation/access_token_store.cc2
-rw-r--r--content/browser/geolocation/access_token_store.h7
-rw-r--r--content/browser/geolocation/fake_access_token_store.cc2
-rw-r--r--content/browser/geolocation/location_arbitrator.cc6
4 files changed, 10 insertions, 7 deletions
diff --git a/content/browser/geolocation/access_token_store.cc b/content/browser/geolocation/access_token_store.cc
index be1e578..45d0203 100644
--- a/content/browser/geolocation/access_token_store.cc
+++ b/content/browser/geolocation/access_token_store.cc
@@ -12,7 +12,7 @@ AccessTokenStore::~AccessTokenStore() {
AccessTokenStore::Handle AccessTokenStore::LoadAccessTokens(
CancelableRequestConsumerBase* consumer,
- LoadAccessTokensCallbackType* callback) {
+ const LoadAccessTokensCallbackType& callback) {
scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request(
new CancelableRequest<LoadAccessTokensCallbackType>(callback));
AddRequest(request, consumer);
diff --git a/content/browser/geolocation/access_token_store.h b/content/browser/geolocation/access_token_store.h
index 804f22b..2089dfb 100644
--- a/content/browser/geolocation/access_token_store.h
+++ b/content/browser/geolocation/access_token_store.h
@@ -16,7 +16,7 @@
#include <map>
-#include "base/callback_old.h"
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/string16.h"
#include "content/browser/cancelable_request.h"
@@ -36,8 +36,9 @@ class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>,
// Map of server URLs to associated access token.
typedef std::map<GURL, string16> AccessTokenSet;
- typedef Callback2<AccessTokenSet, net::URLRequestContextGetter*>::Type
+ typedef base::Callback<void(AccessTokenSet, net::URLRequestContextGetter*)>
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
@@ -47,7 +48,7 @@ class AccessTokenStore : public base::RefCountedThreadSafe<AccessTokenStore>,
// Returns a handle which can subsequently be used with CancelRequest().
CONTENT_EXPORT Handle LoadAccessTokens(
CancelableRequestConsumerBase* consumer,
- LoadAccessTokensCallbackType* callback);
+ const LoadAccessTokensCallbackType& callback);
virtual void SaveAccessToken(
const GURL& server_url, const string16& access_token) = 0;
diff --git a/content/browser/geolocation/fake_access_token_store.cc b/content/browser/geolocation/fake_access_token_store.cc
index 548c127..4b2dc53 100644
--- a/content/browser/geolocation/fake_access_token_store.cc
+++ b/content/browser/geolocation/fake_access_token_store.cc
@@ -19,7 +19,7 @@ FakeAccessTokenStore::FakeAccessTokenStore() {
void FakeAccessTokenStore::NotifyDelegateTokensLoaded() {
CHECK(request_ != NULL);
net::URLRequestContextGetter* context_getter = NULL;
- request_->ForwardResult(MakeTuple(access_token_set_, context_getter));
+ request_->ForwardResult(access_token_set_, context_getter);
request_ = NULL;
}
diff --git a/content/browser/geolocation/location_arbitrator.cc b/content/browser/geolocation/location_arbitrator.cc
index 0160e4e..2765cdc 100644
--- a/content/browser/geolocation/location_arbitrator.cc
+++ b/content/browser/geolocation/location_arbitrator.cc
@@ -6,6 +6,8 @@
#include <map>
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "content/browser/geolocation/arbitrator_dependency_factory.h"
namespace {
@@ -63,8 +65,8 @@ void GeolocationArbitrator::StartProviders(
DCHECK(GURL(kDefaultNetworkProviderUrl).is_valid());
access_token_store_->LoadAccessTokens(
&request_consumer_,
- NewCallback(this,
- &GeolocationArbitrator::OnAccessTokenStoresLoaded));
+ base::Bind(&GeolocationArbitrator::OnAccessTokenStoresLoaded,
+ base::Unretained(this)));
} else {
DoStartProviders();
}