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

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

Issue 17175017: Get rid of RequestRegistry (part 6): get rid of RequestRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 7 years, 6 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
« no previous file with comments | « chrome/browser/google_apis/request_registry.cc ('k') | chrome/browser/google_apis/request_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3251ca5117bffc1de9f1c31e554854b024cdfc60..b9f03018338aadd0be26f3831937e18e7e27d9c3 100644
--- a/chrome/browser/google_apis/request_sender.h
+++ b/chrome/browser/google_apis/request_sender.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_GOOGLE_APIS_REQUEST_SENDER_H_
#define CHROME_BROWSER_GOOGLE_APIS_REQUEST_SENDER_H_
+#include <set>
#include <string>
#include <vector>
@@ -25,7 +26,6 @@ namespace google_apis {
class AuthenticatedRequestInterface;
class AuthService;
-class RequestRegistry;
// Helper class that sends requests implementing
// AuthenticatedRequestInterface and handles retries and authentication.
@@ -45,21 +45,24 @@ class RequestSender {
virtual ~RequestSender();
AuthService* auth_service() { return auth_service_.get(); }
- RequestRegistry* request_registry() {
- return request_registry_.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.
+ // calling back to RetryRequest. The |request| object is owned by this
+ // RequestSender. It will be deleted in RequestSender's destructor or
+ // in RequestFinished().
//
// Returns a closure to cancel the request. The closure cancels the request
// if it is in-flight, and does nothing if it is already terminated.
base::Closure StartRequestWithRetry(AuthenticatedRequestInterface* request);
+ // Notifies to this RequestSender that |request| has finished.
+ // TODO(kinaba): refactor the life time management and make this at private.
+ void RequestFinished(AuthenticatedRequestInterface* request);
+
private:
// Called when the access token is fetched.
void OnAccessTokenFetched(
@@ -79,7 +82,7 @@ class RequestSender {
Profile* profile_; // Not owned.
scoped_ptr<AuthService> auth_service_;
- scoped_ptr<RequestRegistry> request_registry_;
+ std::set<AuthenticatedRequestInterface*> in_flight_requests_;
const std::string custom_user_agent_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « chrome/browser/google_apis/request_registry.cc ('k') | chrome/browser/google_apis/request_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698