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

Issue 100001: Refactor HttpNetworkTransaction to remove side effects in some member functions. (Closed)

Created:
11 years, 8 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Refactor HttpNetworkTransaction to remove side effects in some member functions. I'm preparing to move some of this functionality out to a HttpStream object or something. I'm hindered here by the mutation of state in functions that seemingly should be const. I've refactored some code into non-member functions to make the dependencies more explicit. This will make it easier for me to pull some of this code out. Also dropped the net:: qualifiers in the unittest. TESTED=Ran net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=14772

Patch Set 1 #

Patch Set 2 : Add unittest. #

Total comments: 4

Patch Set 3 : Don't call GetContentLength(), rename tests. #

Total comments: 19

Patch Set 4 : Save on some string copies and temporaries. Address wtc's other comments. #

Total comments: 6

Patch Set 5 : Use the output param directly rather than swapping. #

Patch Set 6 : Use request_headers directly instead of swapping. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+785 lines, -427 lines) Patch
M net/http/http_network_transaction.h View 4 3 chunks +15 lines, -11 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 4 11 chunks +143 lines, -106 lines 2 comments Download
M net/http/http_network_transaction_unittest.cc View 2 3 130 chunks +627 lines, -310 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
willchan no longer on Chromium
11 years, 8 months ago (2009-04-24 23:20:09 UTC) #1
darin (slow to review)
Looks good... just a couple minor comments: http://codereview.chromium.org/100001/diff/2001/3001 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/100001/diff/2001/3001#newcode719 Line 719: request_->upload_data->GetContentLength()) ...
11 years, 8 months ago (2009-04-25 05:59:53 UTC) #2
willchan no longer on Chromium
http://codereview.chromium.org/100001/diff/2001/3001 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/100001/diff/2001/3001#newcode719 Line 719: request_->upload_data->GetContentLength()) { On 2009/04/25 05:59:54, darin wrote: > ...
11 years, 8 months ago (2009-04-25 07:09:21 UTC) #3
wtc
LGTM. You may want to mention the removal of the net:: qualifiers in the CL's ...
11 years, 8 months ago (2009-04-27 23:56:20 UTC) #4
willchan no longer on Chromium
We chatted about this offline and I updated wtc on my plan wrt HttpStream. I've ...
11 years, 8 months ago (2009-04-28 05:42:26 UTC) #5
wtc
LGTM. Please note my questions about the use of 'swap' below, and please remove the ...
11 years, 8 months ago (2009-04-28 17:48:34 UTC) #6
willchan no longer on Chromium
http://codereview.chromium.org/100001/diff/5/1005 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/100001/diff/5/1005#newcode689 Line 689: request_headers_ = BuildTunnelRequest(request_, authorization_headers); On 2009/04/28 17:48:34, wtc ...
11 years, 8 months ago (2009-04-28 17:59:16 UTC) #7
wtc
http://codereview.chromium.org/100001/diff/1019/15 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/100001/diff/1019/15#newcode70 Line 70: StringAppendF(request_headers, "Content-Length: %llu\r\n", I just learned that we're ...
11 years, 7 months ago (2009-04-30 18:57:20 UTC) #8
willchan no longer on Chromium
11 years, 7 months ago (2009-04-30 19:32:39 UTC) #9
http://codereview.chromium.org/100001/diff/1019/15
File net/http/http_network_transaction.cc (right):

http://codereview.chromium.org/100001/diff/1019/15#newcode70
Line 70: StringAppendF(request_headers, "Content-Length: %llu\r\n",
On 2009/04/30 18:57:20, wtc wrote:
> I just learned that we're supposed to use the PRIu64 macro
> instead of llu to print a uint64_t variable:
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=64-bit...

That's for uint64_t.  We're using uint64 here.  uint64!=uint64_t.

Powered by Google App Engine
This is Rietveld 408576698