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

Unified Diff: net/url_request/url_request.cc

Issue 6698009: Add request_id to HttpRequestInfo and pass it to the NetworkDelegate for events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 500 error Created 9 years, 9 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/http/http_request_info.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 17e23a5a90f5a1e9614e16656a0461c203ee01ac..5c437c28c02a1150668d3a97eeb42189015b566f 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -44,7 +44,8 @@ void StripPostSpecificHeaders(HttpRequestHeaders* headers) {
}
// This counter keeps track of the identifiers used for URL requests so far.
-uint64 g_next_url_request_identifier = 0;
+// 0 is reserved to represent an invalid ID.
+uint64 g_next_url_request_identifier = 1;
// This lock protects g_next_url_request_identifier.
base::Lock g_next_url_request_identifier_lock;
@@ -130,6 +131,9 @@ URLRequest::URLRequest(const GURL& url, Delegate* delegate)
}
URLRequest::~URLRequest() {
+ if (context_ && context_->network_delegate())
+ context_->network_delegate()->NotifyURLRequestDestroyed(this);
+
if (before_request_callback_)
before_request_callback_->Cancel();
@@ -362,7 +366,7 @@ void URLRequest::Start() {
before_request_callback_ = new CancelableCompletionCallback<URLRequest>(
this, &URLRequest::BeforeRequestComplete);
if (context_->network_delegate()->NotifyBeforeURLRequest(
- this, before_request_callback_)) {
+ this, before_request_callback_) == net::ERR_IO_PENDING) {
before_request_callback_->AddRef(); // balanced in BeforeRequestComplete
net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_EXTENSION, NULL);
return; // paused
« no previous file with comments | « net/http/http_request_info.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698