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

Issue 2012913002: Deduping conversions between ResourceRequestBody/WebHTTPBody/ExplodedHttpBody. (Closed)

Created:
4 years, 7 months ago by Łukasz Anforowicz
Modified:
4 years, 6 months ago
Reviewers:
Charlie Reis
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@get-rid-of-exploded-http-body
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Deduping conversions between ResourceRequestBody/WebHTTPBody/ExplodedHttpBody. It turns out that https://crrev.com/1987053002 has still left some remaining / unaddressed code deduplication opportunities - they are taken care of by the current CL. The CL replaces the following old fields of ExplodedHttpBody: - std::vector<ExplodedHttpBodyElement> elements - int64_t identifier - bool is_null with a single field: - scoped_ptr<ResourceRequestBody> request_body - the old is_null field is effectively replaced by scoped_ptr - the old identifier is covered by ResourceRequestBody::identifier_ Note that ExplodedHttpBody still contains extra data on top of ResourceRequestBody, like |bool contains_password| and |base::NullableString16| http_content_type (and because of this the whole ExplodedHttpBody struct cannot at this point be replaced with ResourceRequestBody). This CL deletes void AppendHttpBodyElement(const ResourceRequestBodyElement&, WebHTTPBody) function from //content/renderer/http_body_conversions.h and tweaks callsites to instead use scoped_refptr<ResourceRequestBody> GetRequestBodyForWebHTTPBody( const blink::WebHTTPBody& httpBody) which has been extracted from the already existing: scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest( const blink::WebURLRequest& request) (both in content/child/web_url_request_util.h). This CL moves void ConvertToHttpBodyElement(const WebHTTPBody::Element& input, ResourceRequestBody::Element* output) function from //content/renderer/http_body_conversions.h into content/child/web_url_request_util.h and makes this function more generic (i.e. covering the whole ResourceRequestBody rather than working with individual elements): blink::WebHTTPBody GetWebHTTPBodyForRequestBody const scoped_refptr<ResourceRequestBody>& input); BUG=582211 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/9a9ece4a455f8d8849727ceac3e4365d61d11974 Cr-Commit-Position: refs/heads/master@{#396882}

Patch Set 1 #

Patch Set 2 : Rebasing... #

Patch Set 3 : Rebasing... #

Total comments: 3

Patch Set 4 : Extra braces in an "if" statement. #

Patch Set 5 : Calling ResourceRequestBody::AppendFileRange with optional_body_file_path. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -255 lines) Patch
M content/browser/frame_host/frame_navigation_entry.cc View 1 chunk +1 line, -5 lines 0 comments Download
M content/child/web_url_request_util.h View 2 chunks +9 lines, -0 lines 0 comments Download
M content/child/web_url_request_util.cc View 5 chunks +48 lines, -3 lines 0 comments Download
M content/common/page_state_serialization.h View 2 chunks +1 line, -14 lines 0 comments Download
M content/common/page_state_serialization.cc View 10 chunks +24 lines, -50 lines 0 comments Download
M content/common/page_state_serialization_unittest.cc View 4 chunks +27 lines, -28 lines 0 comments Download
M content/content_renderer.gypi View 1 1 chunk +0 lines, -2 lines 0 comments Download
M content/public/common/page_state.cc View 1 2 3 4 1 chunk +8 lines, -6 lines 0 comments Download
M content/renderer/history_serialization.cc View 1 2 3 3 chunks +6 lines, -17 lines 0 comments Download
D content/renderer/http_body_conversions.h View 1 chunk +0 lines, -27 lines 0 comments Download
D content/renderer/http_body_conversions.cc View 1 chunk +0 lines, -85 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 4 chunks +3 lines, -18 lines 0 comments Download

Messages

Total messages: 11 (5 generated)
Łukasz Anforowicz
Charlie, can you take a look please? https://codereview.chromium.org/2012913002/diff/40001/content/public/common/page_state.cc File content/public/common/page_state.cc (left): https://codereview.chromium.org/2012913002/diff/40001/content/public/common/page_state.cc#oldcode95 content/public/common/page_state.cc:95: if (optional_body_file_path) ...
4 years, 7 months ago (2016-05-26 16:26:53 UTC) #3
Charlie Reis
Wow, this is even nicer. Much appreciated! LGTM with one request below. https://codereview.chromium.org/2012913002/diff/40001/content/public/common/page_state.cc File content/public/common/page_state.cc ...
4 years, 6 months ago (2016-05-27 21:45:53 UTC) #4
Łukasz Anforowicz
Thanks for reviewing. https://codereview.chromium.org/2012913002/diff/40001/content/public/common/page_state.cc File content/public/common/page_state.cc (left): https://codereview.chromium.org/2012913002/diff/40001/content/public/common/page_state.cc#oldcode95 content/public/common/page_state.cc:95: if (optional_body_file_path) { On 2016/05/27 21:45:53, ...
4 years, 6 months ago (2016-05-31 16:38:04 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2012913002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2012913002/80001
4 years, 6 months ago (2016-05-31 18:03:37 UTC) #8
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 6 months ago (2016-05-31 19:01:52 UTC) #9
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 19:04:35 UTC) #11
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/9a9ece4a455f8d8849727ceac3e4365d61d11974
Cr-Commit-Position: refs/heads/master@{#396882}

Powered by Google App Engine
This is Rietveld 408576698