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

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

Created:
4 years, 7 months ago by Łukasz Anforowicz
Modified:
4 years, 7 months ago
Reviewers:
danakj, 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, clamy
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Relanding: 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, 614299 Committed: https://crrev.com/28b27bcc839a67e8a44a18536cd587fd0746ee40 Cr-Commit-Position: refs/heads/master@{#396043}

Patch Set 1 : Original CL (from https://crrev.com/1987053002) #

Patch Set 2 : Fixing dbg-only crash when bytes() is called on empty storage::DataElement. #

Total comments: 4

Patch Set 3 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -224 lines) Patch
M content/common/page_state_serialization.h View 2 chunks +2 lines, -16 lines 0 comments Download
M content/common/page_state_serialization.cc View 8 chunks +44 lines, -48 lines 0 comments Download
M content/common/page_state_serialization_unittest.cc View 3 chunks +22 lines, -24 lines 0 comments Download
M content/common/resource_request_body.h View 2 chunks +0 lines, -4 lines 0 comments Download
M content/common/resource_request_body.cc View 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 2 chunks +6 lines, -7 lines 0 comments Download
M content/renderer/history_serialization.cc View 5 chunks +6 lines, -52 lines 0 comments Download
A content/renderer/http_body_conversions.h View 1 chunk +27 lines, -0 lines 0 comments Download
A content/renderer/http_body_conversions.cc View 1 1 chunk +85 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 2 chunks +3 lines, -28 lines 0 comments Download
M storage/common/data_element.h View 1 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (6 generated)
Łukasz Anforowicz
Charlie, could you please take a look? This is a reland, so you probably only ...
4 years, 7 months ago (2016-05-25 00:26:18 UTC) #3
Charlie Reis
Works for me. Unfortunate that we don't have any debug build try jobs to catch ...
4 years, 7 months ago (2016-05-25 19:01:06 UTC) #4
Łukasz Anforowicz
Dana, could you please take a look at the changes in storage/common/data_element.h? I tried to ...
4 years, 7 months ago (2016-05-25 21:00:26 UTC) #6
danakj
https://codereview.chromium.org/2006053004/diff/20001/storage/common/data_element.h File storage/common/data_element.h (right): https://codereview.chromium.org/2006053004/diff/20001/storage/common/data_element.h#newcode45 storage/common/data_element.h:45: const char* bytes() const { return bytes_ ? bytes_ ...
4 years, 7 months ago (2016-05-25 22:13:46 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2006053004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2006053004/40001
4 years, 7 months ago (2016-05-25 22:20:34 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 7 months ago (2016-05-25 23:45:46 UTC) #11
commit-bot: I haz the power
4 years, 7 months ago (2016-05-25 23:47:13 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/28b27bcc839a67e8a44a18536cd587fd0746ee40
Cr-Commit-Position: refs/heads/master@{#396043}

Powered by Google App Engine
This is Rietveld 408576698