|
|
Created:
3 years, 10 months ago by tfarina Modified:
3 years, 10 months ago CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org, yamaguchi+watch_chromium.org, oka+watch_chromium.org, jam, net-reviews_chromium.org, darin-cc_chromium.org, fukino+watch_chromium.org, mmenke Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Descriptionnet: remove GetNormalizedHeaders() function
It is only used by some logging and test functions. It should be safe to
replace those callers with ConvertHeadersBackToHTTPResponse().
This cleans up Darin's TODO.
BUG=488593
TEST=net_unittests
R=eroman@chromium.org,rogerta@chromium.org,sky@chromium.org
Review-Url: https://codereview.chromium.org/2670013002
Cr-Commit-Position: refs/heads/master@{#451455}
Committed: https://chromium.googlesource.com/chromium/src/+/ff7fdbb297f5430b4fa34ececfb736743c4d9994
Patch Set 1 #
Total comments: 2
Patch Set 2 : review #Patch Set 3 : fix UpdatesRequestResponseTimeOn304 #Patch Set 4 : REBASE #Patch Set 5 : revert unintended changes in http_response_headers_unittest.cc #Patch Set 6 : ToSimpleString() #Patch Set 7 : fix compilation - but problem still there #Patch Set 8 : all HttpCache tests passes now #Patch Set 9 : remove verification #
Total comments: 3
Patch Set 10 : add TODO #Patch Set 11 : n #
Messages
Total messages: 55 (36 generated)
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Looks good once http_response_headers_unittest.cc is updated! https://codereview.chromium.org/2670013002/diff/1/google_apis/drive/base_requ... File google_apis/drive/base_requests.cc (right): https://codereview.chromium.org/2670013002/diff/1/google_apis/drive/base_requ... google_apis/drive/base_requests.cc:104: headers.assign(net::HttpUtil::ConvertHeadersBackToHTTPResponse( Please use assignment here instead: headers = ConvertHeadersBackToXXX(...);
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/02/02 03:14:12, eroman (slow) wrote: > Looks good once http_response_headers_unittest.cc is updated! > Eric, could you help me with that? I'm looking at fixing the http_cache tests as well. https://codereview.chromium.org/2670013002/diff/1/google_apis/drive/base_requ... File google_apis/drive/base_requests.cc (right): https://codereview.chromium.org/2670013002/diff/1/google_apis/drive/base_requ... google_apis/drive/base_requests.cc:104: headers.assign(net::HttpUtil::ConvertHeadersBackToHTTPResponse( On 2017/02/02 03:14:12, eroman (slow) wrote: > Please use assignment here instead: > headers = ConvertHeadersBackToXXX(...); Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
Sure, I will send a CL to update the http_response_headers_unittests
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi Eric, could you take another look? https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... File net/http/http_cache_unittest.cc (right): https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... net/http/http_cache_unittest.cc:83: std::string ToSimpleString(const scoped_refptr<HttpResponseHeaders>& parsed) { Sorry, I had to steal your function. Maybe we can come up with some simpler?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... File net/http/http_cache_unittest.cc (right): https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... net/http/http_cache_unittest.cc:83: std::string ToSimpleString(const scoped_refptr<HttpResponseHeaders>& parsed) { On 2017/02/14 22:13:18, tfarina wrote: > Sorry, I had to steal your function. Maybe we can come up with some simpler? Can you add a TODO explaining this is a duplicate of the other function?
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
tfarina@chromium.org changed reviewers: + rogerta@chromium.org, sky@chromium.org
Adding owners: Scott -> content Roger -> google_apis https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... File net/http/http_cache_unittest.cc (right): https://codereview.chromium.org/2670013002/diff/160001/net/http/http_cache_un... net/http/http_cache_unittest.cc:83: std::string ToSimpleString(const scoped_refptr<HttpResponseHeaders>& parsed) { On 2017/02/16 20:37:35, eroman wrote: > On 2017/02/14 22:13:18, tfarina wrote: > > Sorry, I had to steal your function. Maybe we can come up with some simpler? > > Can you add a TODO explaining this is a duplicate of the other function? Done.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Comments in the function being removed mention being careful about spacing and commas and such, which I don't see in the replacement: https://cs.chromium.org/chromium/src/net/http/http_util.cc?rcl=1033be6d096d43... but if you say they are equivalent then google_apis lgtm
The new approach that Thiago is using does not have those same limitations, so the comment is no longer applicable. Previously, GetNormalizedHeaders() would try to coalesce headers with the same name. For instance if the original headers (raw_headers) had been: Set-Cookie: a Set-Cookie: b Then GetNormalizedHeaders() would have (incorrectly) returned: Set-Cookie: a, b Whereas after this change, the headers string that will be logged is the same two Set-Cookie lines as the actual headers included (just without the superfluous spaces): Set-Cookie: a Set-Cookie: b In this case what GetNormalizedHeaders() was returning was wrong as it has a different semantic meaning. Set-Cookie is expected to be a human-readable date string which may in itself contain commas, so combining it like this was what the "Danger" was referring to. (Combining repeated headers with a comma does make sense for other header types like Cache-Control). The new approach proposed by this CL preserves the source headers and values without trying to combine repeated headers. For the sake of logging in google_apis I believe this is an overall better choice.
(Small correction, the whitespace would be preserved too)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks for the explanation Eric. Still lgtm
LGTM
The CQ bit was checked by tfarina@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from eroman@chromium.org Link to the patchset: https://codereview.chromium.org/2670013002/#ps200001 (title: "n")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== net: remove GetNormalizedHeaders() function It is only used by some logging and test functions. It should be safe to replace those callers with ConvertHeadersBackToHTTPResponse(). This cleans up Darin's TODO. BUG=488593 TEST=net_unittests R=eroman@chromium.org ========== to ========== net: remove GetNormalizedHeaders() function It is only used by some logging and test functions. It should be safe to replace those callers with ConvertHeadersBackToHTTPResponse(). This cleans up Darin's TODO. BUG=488593 TEST=net_unittests R=eroman@chromium.org,rogerta@chromium.org,sky@chromium.org ==========
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
The CQ bit was checked by tfarina@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
The CQ bit was checked by tfarina@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
The CQ bit was checked by tfarina@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 200001, "attempt_start_ts": 1487415188168990, "parent_rev": "5cd9ae8889c732428043460caa5d0fd8043041c1", "commit_rev": "ff7fdbb297f5430b4fa34ececfb736743c4d9994"}
Message was sent while issue was closed.
Description was changed from ========== net: remove GetNormalizedHeaders() function It is only used by some logging and test functions. It should be safe to replace those callers with ConvertHeadersBackToHTTPResponse(). This cleans up Darin's TODO. BUG=488593 TEST=net_unittests R=eroman@chromium.org,rogerta@chromium.org,sky@chromium.org ========== to ========== net: remove GetNormalizedHeaders() function It is only used by some logging and test functions. It should be safe to replace those callers with ConvertHeadersBackToHTTPResponse(). This cleans up Darin's TODO. BUG=488593 TEST=net_unittests R=eroman@chromium.org,rogerta@chromium.org,sky@chromium.org Review-Url: https://codereview.chromium.org/2670013002 Cr-Commit-Position: refs/heads/master@{#451455} Committed: https://chromium.googlesource.com/chromium/src/+/ff7fdbb297f5430b4fa34ececfb7... ==========
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as https://chromium.googlesource.com/chromium/src/+/ff7fdbb297f5430b4fa34ececfb7... |