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

Unified Diff: net/url_request/report_sender.cc

Issue 2385003002: Remove stl_util's deletion functions from net/url_request/. (Closed)
Patch Set: to map Created 4 years, 2 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 | « net/url_request/report_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/report_sender.cc
diff --git a/net/url_request/report_sender.cc b/net/url_request/report_sender.cc
index 16503608f9c4354f5b807135b909b57ddd149a48..b99ef692d6b18e086359ee9c10df163429b1cea0 100644
--- a/net/url_request/report_sender.cc
+++ b/net/url_request/report_sender.cc
@@ -6,7 +6,6 @@
#include <utility>
-#include "base/stl_util.h"
#include "net/base/elements_upload_data_stream.h"
#include "net/base/load_flags.h"
#include "net/base/request_priority.h"
@@ -28,8 +27,6 @@ ReportSender::ReportSender(URLRequestContext* request_context,
error_callback_(error_callback) {}
ReportSender::~ReportSender() {
- // Cancel all of the uncompleted requests.
- base::STLDeleteElements(&inflight_requests_);
}
void ReportSender::Send(const GURL& report_uri,
@@ -59,7 +56,7 @@ void ReportSender::Send(const GURL& report_uri,
ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
URLRequest* raw_url_request = url_request.get();
- inflight_requests_.insert(url_request.release());
+ inflight_requests_[raw_url_request] = std::move(url_request);
raw_url_request->Start();
}
@@ -77,8 +74,6 @@ void ReportSender::OnResponseStarted(URLRequest* request, int net_error) {
}
CHECK_GT(inflight_requests_.erase(request), 0u);
- // Clean up the request, which cancels it.
- delete request;
}
void ReportSender::OnReadCompleted(URLRequest* request, int bytes_read) {
« no previous file with comments | « net/url_request/report_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698