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

Issue 1987053002: Deduplicating code performing WebHTTPBody::Element conversions. (Closed)

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

Description

Deduplicating code performing WebHTTPBody::Element conversions. Before this CL, there were 2 separate structs in //content layer holding essentially the same information about parts of http body: ResourceRequestBody::Element and ExplodedHttpBodyElement. To deal with 2 separate structs, recent CLs had to introduce duplicated, copy & pasted code that performed conversions between WebHTTPBody::Element from the Blink layer and the 2 structs in the //content layer. Examples: 1. https://crrev.com/1956383003: 1.a. AddHTTPBodyToRequest in //content/renderer/render_frame_impl.cc duplicated code from //content/renderer/history_serialization.cc 2. https://crrev.com/1907443006: 2.a. Almost exactly the same as above, AddHTTPBodyToRequest in //content/renderer/render_frame_impl.cc duplicated code from //content/renderer/history_serialization.cc 2.b. ResourceRequestBody::AppendExplodedHTTPBodyElement in //content/common/resource_request_body.cc was duplicating The current CL removes the duplicated code by making ExplodedHttpBodyElement a type alias for ResourceRequestBody::Element and removing code that dealt with the old ExplodedHttpBodyElement struct. BUG=582211 Committed: https://crrev.com/2d0c9ae694afcb5c16028222e206b64aaba0cdba Cr-Commit-Position: refs/heads/master@{#395461}

Patch Set 1 #

Patch Set 2 : Fixed building of unit tests + fixed conversion of type id values. #

Patch Set 3 : Deduplicating conversion routines. #

Patch Set 4 : Removing more things (from rebasing/including clamy@'s CL). #

Patch Set 5 : Self-review. #

Patch Set 6 : Rebasing on top of ToT... #

Total comments: 5

Patch Set 7 : s/data/test_body/g #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -224 lines) Patch
M content/common/page_state_serialization.h View 1 2 3 2 chunks +2 lines, -16 lines 0 comments Download
M content/common/page_state_serialization.cc View 1 2 3 8 chunks +44 lines, -48 lines 0 comments Download
M content/common/page_state_serialization_unittest.cc View 1 2 3 4 5 6 3 chunks +22 lines, -24 lines 0 comments Download
M content/common/resource_request_body.h View 1 2 3 2 chunks +0 lines, -4 lines 0 comments Download
M content/common/resource_request_body.cc View 1 2 3 1 chunk +0 lines, -44 lines 0 comments Download
M content/content_renderer.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/common/page_state.cc View 1 2 chunks +6 lines, -7 lines 0 comments Download
M content/renderer/history_serialization.cc View 1 2 5 chunks +6 lines, -52 lines 0 comments Download
A content/renderer/http_body_conversions.h View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
A content/renderer/http_body_conversions.cc View 1 2 3 4 1 chunk +84 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 2 chunks +4 lines, -29 lines 0 comments Download

Messages

Total messages: 16 (8 generated)
Łukasz Anforowicz
Charlie, can you take a look please? https://codereview.chromium.org/1987053002/diff/100001/content/renderer/history_serialization.cc File content/renderer/history_serialization.cc (left): https://codereview.chromium.org/1987053002/diff/100001/content/renderer/history_serialization.cc#oldcode84 content/renderer/history_serialization.cc:84: } These ...
4 years, 7 months ago (2016-05-20 22:14:07 UTC) #5
Charlie Reis
Very happy to see the duplicated code removed-- thanks! LGTM with one sanity check about ...
4 years, 7 months ago (2016-05-23 19:58:30 UTC) #7
Łukasz Anforowicz
Thanks for reviewing. https://codereview.chromium.org/1987053002/diff/100001/content/common/page_state_serialization.cc File content/common/page_state_serialization.cc (right): https://codereview.chromium.org/1987053002/diff/100001/content/common/page_state_serialization.cc#newcode45 content/common/page_state_serialization.cc:45: base::FilePath::FromUTF16Unsafe(file_path.string()), On 2016/05/23 19:58:30, Charlie Reis ...
4 years, 7 months ago (2016-05-23 22:13:34 UTC) #8
Charlie Reis
Thanks! LGTM.
4 years, 7 months ago (2016-05-23 22:17:01 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987053002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1987053002/120001
4 years, 7 months ago (2016-05-23 22:21:53 UTC) #11
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 7 months ago (2016-05-23 23:28:21 UTC) #13
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/2d0c9ae694afcb5c16028222e206b64aaba0cdba Cr-Commit-Position: refs/heads/master@{#395461}
4 years, 7 months ago (2016-05-23 23:34:58 UTC) #15
kolos1
4 years, 6 months ago (2016-05-24 08:55:16 UTC) #16
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2002413002/ by kolos@chromium.org.

The reason for reverting is: This CL causes failures in content_browsertests and
browser_tests
(https://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%2...
) 

BUG=614299.

Powered by Google App Engine
This is Rietveld 408576698