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

Unified Diff: chrome/browser/google_apis/request_sender.h

Issue 19511002: Change google_api::RequestSender to take an AuthService instead of a Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/google_apis/request_sender.h
diff --git a/chrome/browser/google_apis/request_sender.h b/chrome/browser/google_apis/request_sender.h
index 96b3fd10208468309469d4147575e2b4650f27d6..2e1a94bd9248ef9a9dcd69d76ecc1f41ac589ade 100644
--- a/chrome/browser/google_apis/request_sender.h
+++ b/chrome/browser/google_apis/request_sender.h
@@ -30,12 +30,15 @@ class URLRequestContextGetter;
namespace google_apis {
class AuthenticatedRequestInterface;
-class AuthService;
+class AuthServiceInterface;
// Helper class that sends requests implementing
// AuthenticatedRequestInterface and handles retries and authentication.
class RequestSender {
public:
+ // |auth_service| is used for fetching OAuth tokens. It'll be owned by
+ // this RequestSender.
+ //
// |url_request_context_getter| is the context used to perform network
// requests from this RequestSender.
//
@@ -46,14 +49,13 @@ class RequestSender {
//
// |custom_user_agent| will be used for the User-Agent header in HTTP
// requests issued through the request sender if the value is not empty.
- RequestSender(Profile* profile,
+ RequestSender(AuthServiceInterface* auth_service,
net::URLRequestContextGetter* url_request_context_getter,
base::TaskRunner* blocking_task_runner,
- const std::vector<std::string>& scopes,
const std::string& custom_user_agent);
- virtual ~RequestSender();
+ ~RequestSender();
- AuthService* auth_service() { return auth_service_.get(); }
+ AuthServiceInterface* auth_service() { return auth_service_.get(); }
net::URLRequestContextGetter* url_request_context_getter() const {
return url_request_context_getter_;
@@ -63,9 +65,6 @@ class RequestSender {
return blocking_task_runner_.get();
}
- // Prepares the object for use.
- virtual void Initialize();
-
// Starts a request implementing the AuthenticatedRequestInterface
// interface, and makes the request retry upon authentication failures by
// calling back to RetryRequest. The |request| object is owned by this
@@ -96,11 +95,10 @@ class RequestSender {
void CancelRequest(
const base::WeakPtr<AuthenticatedRequestInterface>& request);
- Profile* profile_; // Not owned.
+ scoped_ptr<AuthServiceInterface> auth_service_;
net::URLRequestContextGetter* url_request_context_getter_; // Not owned.
scoped_refptr<base::TaskRunner> blocking_task_runner_;
- scoped_ptr<AuthService> auth_service_;
std::set<AuthenticatedRequestInterface*> in_flight_requests_;
const std::string custom_user_agent_;
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_requests_unittest.cc ('k') | chrome/browser/google_apis/request_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698