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

Issue 1422473004: Vector-of-structs (instead of struct-of-vectors) in "savable resources" IPC. (Closed)

Created:
5 years, 1 month ago by Łukasz Anforowicz
Modified:
5 years, 1 month ago
Reviewers:
ncarter (slow), dcheng
CC:
asanka, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@page-serialization-original-url-yay
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Vector-of-structs (instead of struct-of-vectors) in "savable resources" IPC. It is cleaner to send a vector-of-structs rather than a struct-of-vectors (i.e. no need to verify the size of the vectors is the same, iteration is easier as it doesn't require an index to look into both vectors). This CL changes how "subframes" are sent in FrameHostMsg_SavableResourceLinksResponse. They used to be sent as 2 vectors (of URLs and of routing_ids) and now they are sent as a single vector (of a struct that contains URLs and routing_ids). The same struct (content::SavableSubframe) is reused to return results out of GetSavableResourceLinksForFrame in savable_resources.cc. The decision to reuse the same struct necessitates 1) sharing/reusing GetRoutingIdForFrameOrProxy across render_frame_impl.cc and savable_resources.cc and (so GetRoutingIdForFrameOrProxy has been moved to web_frame_utils compilation unit) 2) introducing a content::SavableSubframe struct that can be shared via A) IPC handlers in browser and renderer and B) by savable_resources.cc (and addressing B seemed better with an explicit struct with a short name, rather than introducing an implicit struct via IPC_STRUCT_BEGIN). Note that this CL keeps using a struct-of-vectors for reporting savable resources (URL + referrer). This will be addressed in a separate CL (crrev.com/1425013004). BUG=526786 Committed: https://crrev.com/779a08f834625617d79a14be44871bbc84ab2574 Cr-Commit-Position: refs/heads/master@{#357852}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fixing SavableResourcesTest. #

Patch Set 3 : Added missing includes to web_frame_utils.cc #

Patch Set 4 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -55 lines) Patch
M content/browser/download/save_package.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/download/save_package.cc View 1 2 3 2 chunks +4 lines, -11 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 3 chunks +8 lines, -3 lines 0 comments Download
A content/common/savable_subframe.h View 1 chunk +23 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 5 chunks +5 lines, -22 lines 0 comments Download
M content/renderer/savable_resources.h View 1 2 3 2 chunks +4 lines, -8 lines 0 comments Download
M content/renderer/savable_resources.cc View 1 2 3 2 chunks +8 lines, -3 lines 0 comments Download
M content/renderer/savable_resources_browsertest.cc View 1 2 3 2 chunks +6 lines, -6 lines 0 comments Download
A content/renderer/web_frame_utils.h View 1 chunk +20 lines, -0 lines 0 comments Download
A content/renderer/web_frame_utils.cc View 1 2 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
Łukasz Anforowicz
Daniel + Nick - could you please take a look?
5 years, 1 month ago (2015-10-28 17:02:28 UTC) #2
ncarter (slow)
lgtm https://codereview.chromium.org/1422473004/diff/1/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1422473004/diff/1/content/common/frame_messages.h#newcode402 content/common/frame_messages.h:402: IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) Just mentioning this as an option in ...
5 years, 1 month ago (2015-10-28 22:28:39 UTC) #4
ncarter (slow)
https://codereview.chromium.org/1422473004/diff/1/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1422473004/diff/1/content/common/frame_messages.h#newcode402 content/common/frame_messages.h:402: IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) On 2015/10/28 22:28:38, ncarter wrote: > Just mentioning ...
5 years, 1 month ago (2015-10-28 22:29:34 UTC) #5
Łukasz Anforowicz
Thanks for the feedback and apologies for rushing this CL a little bit (missing header ...
5 years, 1 month ago (2015-10-28 23:12:06 UTC) #6
ncarter (slow)
ps1 vs ps3 lgtm
5 years, 1 month ago (2015-10-28 23:25:12 UTC) #7
dcheng
lgtm
5 years, 1 month ago (2015-10-29 00:23:58 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1422473004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1422473004/60001
5 years, 1 month ago (2015-11-04 17:27:01 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 1 month ago (2015-11-04 18:27:11 UTC) #12
commit-bot: I haz the power
5 years, 1 month ago (2015-11-04 18:27:54 UTC) #13
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/779a08f834625617d79a14be44871bbc84ab2574
Cr-Commit-Position: refs/heads/master@{#357852}

Powered by Google App Engine
This is Rietveld 408576698