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

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

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_sender.h ('k') | chrome/browser/sync_file_system/drive/api_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/request_sender.cc
diff --git a/chrome/browser/google_apis/request_sender.cc b/chrome/browser/google_apis/request_sender.cc
index a5c268bc32dcbc7d1451ec4c42b9a2bc3b7dc017..d39e245642d5f18fe47d671dd2c20f09aef9c496 100644
--- a/chrome/browser/google_apis/request_sender.cc
+++ b/chrome/browser/google_apis/request_sender.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/google_apis/request_sender.h"
#include "base/bind.h"
+#include "base/stl_util.h"
#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/base_requests.h"
@@ -17,7 +18,6 @@ RequestSender::RequestSender(
const std::string& custom_user_agent)
: profile_(profile),
auth_service_(new AuthService(url_request_context_getter, scopes)),
- request_registry_(new RequestRegistry()),
custom_user_agent_(custom_user_agent),
weak_ptr_factory_(this) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -25,6 +25,8 @@ RequestSender::RequestSender(
RequestSender::~RequestSender() {
DCHECK(thread_checker_.CalledOnValidThread());
+ STLDeleteContainerPointers(in_flight_requests_.begin(),
+ in_flight_requests_.end());
}
void RequestSender::Initialize() {
@@ -36,6 +38,8 @@ base::Closure RequestSender::StartRequestWithRetry(
AuthenticatedRequestInterface* request) {
DCHECK(thread_checker_.CalledOnValidThread());
+ in_flight_requests_.insert(request);
+
// TODO(kinaba): Stop relying on weak pointers. Move lifetime management
// of the requests to request sender.
base::Closure cancel_closure =
@@ -96,4 +100,9 @@ void RequestSender::CancelRequest(
request->Cancel();
}
+void RequestSender::RequestFinished(AuthenticatedRequestInterface* request) {
+ in_flight_requests_.erase(request);
+ delete request;
+}
+
} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/request_sender.h ('k') | chrome/browser/sync_file_system/drive/api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698