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

Side by Side 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: net and cache intercept 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/stats_counters.h" 9 #include "base/metrics/stats_counters.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 25 matching lines...) Expand all
36 // Discard headers which have meaning in POST (Content-Length, Content-Type, 36 // Discard headers which have meaning in POST (Content-Length, Content-Type,
37 // Origin). 37 // Origin).
38 void StripPostSpecificHeaders(net::HttpRequestHeaders* headers) { 38 void StripPostSpecificHeaders(net::HttpRequestHeaders* headers) {
39 // These are headers that may be attached to a POST. 39 // These are headers that may be attached to a POST.
40 headers->RemoveHeader(net::HttpRequestHeaders::kContentLength); 40 headers->RemoveHeader(net::HttpRequestHeaders::kContentLength);
41 headers->RemoveHeader(net::HttpRequestHeaders::kContentType); 41 headers->RemoveHeader(net::HttpRequestHeaders::kContentType);
42 headers->RemoveHeader(net::HttpRequestHeaders::kOrigin); 42 headers->RemoveHeader(net::HttpRequestHeaders::kOrigin);
43 } 43 }
44 44
45 // This counter keeps track of the identifiers used for URL requests so far. 45 // This counter keeps track of the identifiers used for URL requests so far.
46 uint64 g_next_url_request_identifier = 0; 46 uint64 g_next_url_request_identifier = 1;
willchan no longer on Chromium 2011/03/17 15:55:54 Document that we start at 1 since 0 represents an
Matt Perry 2011/03/22 21:11:43 Done.
47 47
48 // This lock protects g_next_url_request_identifier. 48 // This lock protects g_next_url_request_identifier.
49 base::Lock g_next_url_request_identifier_lock; 49 base::Lock g_next_url_request_identifier_lock;
50 50
51 // Returns an prior unused identifier for URL requests. 51 // Returns an prior unused identifier for URL requests.
52 uint64 GenerateURLRequestIdentifier() { 52 uint64 GenerateURLRequestIdentifier() {
53 base::AutoLock lock(g_next_url_request_identifier_lock); 53 base::AutoLock lock(g_next_url_request_identifier_lock);
54 return g_next_url_request_identifier++; 54 return g_next_url_request_identifier++;
55 } 55 }
56 56
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 if (found != user_data_.end()) 664 if (found != user_data_.end())
665 return found->second.get(); 665 return found->second.get();
666 return NULL; 666 return NULL;
667 } 667 }
668 668
669 void URLRequest::SetUserData(const void* key, UserData* data) { 669 void URLRequest::SetUserData(const void* key, UserData* data) {
670 user_data_[key] = linked_ptr<UserData>(data); 670 user_data_[key] = linked_ptr<UserData>(data);
671 } 671 }
672 672
673 } // namespace net 673 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698