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

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed)

Created:
4 years, 7 months ago by Łukasz Anforowicz
Modified:
4 years, 6 months ago
Reviewers:
clamy, Charlie Reis, jam, sky, scottmg
CC:
chromium-reviews, loading-reviews_chromium.org, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, creis+watch_chromium.org, 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

Forwarding POST body into renderer after a cross-site transfer. After this CL, ResourceRequestBody from ResourceHostMsg_Request will get sent after a cross-site transfer in FrameMsg_Navigate: - ResourceDispatcherHostImpl::BeginRequest stores ResourceHostMsg_Request::request_body into ResourceRequestInfoImpl::body_ - NavigationResourceThrottle::WillStartRequest forwards ResourceRequestInfoImpl::body_ into a call to NavigationHandleImpl::WillStartRequest, where the body gets stored in NavigationHandleImpl::resource_request_body_ - NavigationHandleImpl::WillRedirectRequest takes care to reset the body if a redirect changed the method to a non-POST. (see also https://crbug.com/582211#c22). - RenderFrameHostManager::OnCrossSiteResponse forwards NavigationHandleImpl::resource_request_body_ into the call to NavigatorImpl::RequestTransferURL. The body is used to set the proper method on FrameNavigationEntry and used to populate CommonNavigationParams. BUG=582211, 613004 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/5aa2c3740801f1c148c85db6612c24be0a76b6fe Cr-Commit-Position: refs/heads/master@{#397779}

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 8

Patch Set 3 : Seems to work and fixes some tests under --site-per-process. #

Patch Set 4 : Fixing building of content_browsertests. #

Patch Set 5 : Check for nullptr before calling AddHTTPBodyToRequest. #

Total comments: 1

Patch Set 6 : Also retaining HTTP method during transfer (via NavigationHandle). #

Patch Set 7 : Extracted a shared NavigationEntryImpl::ConstructResourceRequestBody. #

Total comments: 12

Patch Set 8 : Addressed CR feedback from clamy@. #

Patch Set 9 : Attempting to rebase on top of clamy@'s other CL. #

Total comments: 8

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

Patch Set 11 : Addressed CR feedback from clamy@. #

Patch Set 12 : Rebased on top of separate CL that moves POST body to CommonNavigationParams. #

Total comments: 6

Patch Set 13 : NavigationHandle public API change: IsPost -> GetMethod. #

Patch Set 14 : Rebasing... #

Total comments: 17

Patch Set 15 : Addressed CR feedback from clamy@ (DCHECKs, comments, more resetting on redirect). #

Patch Set 16 : Added POST body in test code + relaxed a DCHECK to account for broken history navigations. #

Patch Set 17 : Further tweaking the DCHECKs in constructor of CommonNavigationParams. #

Patch Set 18 : More tweaks of the DCHECKs in constructor of CommonNavigationParams. #

Total comments: 6

Patch Set 19 : Relaxed and simplified DCHECKs to only verify |method != "POST"| case. #

Total comments: 17

Patch Set 20 : Rebasing... #

Patch Set 21 : Moved variable initialization slightly earlier. #

Patch Set 22 : GoBackToCrossSitePostWithRedirect is fixed by this CL. #

Total comments: 9

Patch Set 23 : DCHECK tweaks, NH::GetMethod->IsPost, more resetting of http body, DEPS tweaks. #

Patch Set 24 : Rebasing + fixing build issues caused by IsPost-vs-GetMethod tweaks. #

Patch Set 25 : Removed DCHECK_IMPLIES(method == "POST", url.SchemeIs(http or https)). #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -106 lines) Patch
M chrome/test/base/ui_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +22 lines, -6 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 4 chunks +27 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +5 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigator_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +14 lines, -9 lines 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 9 chunks +21 lines, -13 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +6 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +2 lines, -1 line 0 comments Download
M content/browser/loader/navigation_resource_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +22 lines, -13 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -5 lines 0 comments Download
M content/browser/loader/resource_request_info_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +7 lines, -1 line 0 comments Download
M content/browser/loader/resource_request_info_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +37 lines, -32 lines 0 comments Download
M content/common/navigation_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +10 lines, -1 line 0 comments Download
M content/public/browser/navigation_handle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +7 lines, -2 lines 1 comment Download
M testing/buildbot/filters/site-per-process.content_browsertests.filter View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/site-per-process View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 50 (15 generated)
Łukasz Anforowicz
https://codereview.chromium.org/1956383003/diff/1/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1956383003/diff/1/content/browser/frame_host/navigator_impl.cc#newcode819 content/browser/frame_host/navigator_impl.cc:819: // Option #2: Add the body to either FrameNav...Entry ...
4 years, 7 months ago (2016-05-10 00:49:37 UTC) #2
Łukasz Anforowicz
Camille, could you please take a quick look at this CL? This CL is very ...
4 years, 7 months ago (2016-05-12 03:05:41 UTC) #4
clamy
On 2016/05/12 03:05:41, Łukasz Anforowicz wrote: > Camille, could you please take a quick look ...
4 years, 7 months ago (2016-05-12 05:31:18 UTC) #5
clamy
https://codereview.chromium.org/1956383003/diff/20001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1956383003/diff/20001/content/browser/frame_host/navigator_impl.cc#newcode382 content/browser/frame_host/navigator_impl.cc:382: *dest_render_frame_host->navigation_handle()), This is unsafe. In non transfer cases the ...
4 years, 7 months ago (2016-05-12 05:32:48 UTC) #6
Łukasz Anforowicz
Camille, could you please take another look? I think the remaining potential issues are: - ...
4 years, 7 months ago (2016-05-17 23:52:56 UTC) #8
clamy
On 2016/05/17 23:52:56, Łukasz Anforowicz wrote: > Camille, could you please take another look? I ...
4 years, 7 months ago (2016-05-18 15:46:26 UTC) #9
Łukasz Anforowicz
On 2016/05/18 15:46:26, clamy wrote: > On 2016/05/17 23:52:56, Łukasz Anforowicz wrote: > > Camille, ...
4 years, 7 months ago (2016-05-18 22:50:16 UTC) #10
clamy
Thanks! A few more comments. On the deduplication side, I don't think it matters much ...
4 years, 7 months ago (2016-05-19 16:08:01 UTC) #11
Łukasz Anforowicz
Thanks for reviewing, can you take another look? On 2016/05/19 16:08:01, clamy wrote: > Thanks! ...
4 years, 7 months ago (2016-05-19 18:06:59 UTC) #12
clamy
Thanks! A few comments on the rebase (I haven't had time to do a full ...
4 years, 7 months ago (2016-05-20 15:49:14 UTC) #13
Łukasz Anforowicz
Camille, can you take another look please? https://codereview.chromium.org/1956383003/diff/120001/content/browser/frame_host/navigation_entry_impl.h File content/browser/frame_host/navigation_entry_impl.h (right): https://codereview.chromium.org/1956383003/diff/120001/content/browser/frame_host/navigation_entry_impl.h#newcode163 content/browser/frame_host/navigation_entry_impl.h:163: scoped_refptr<ResourceRequestBody> ConstructResourceRequestBody() ...
4 years, 7 months ago (2016-05-20 22:18:48 UTC) #15
clamy
Thanks! It's looking mostly good. https://codereview.chromium.org/1956383003/diff/220001/content/browser/frame_host/navigation_handle_impl.h File content/browser/frame_host/navigation_handle_impl.h (right): https://codereview.chromium.org/1956383003/diff/220001/content/browser/frame_host/navigation_handle_impl.h#newcode167 content/browser/frame_host/navigation_handle_impl.h:167: const std::string& method() const ...
4 years, 7 months ago (2016-05-23 15:32:28 UTC) #17
Łukasz Anforowicz
https://codereview.chromium.org/1956383003/diff/220001/content/browser/frame_host/navigation_handle_impl.h File content/browser/frame_host/navigation_handle_impl.h (right): https://codereview.chromium.org/1956383003/diff/220001/content/browser/frame_host/navigation_handle_impl.h#newcode167 content/browser/frame_host/navigation_handle_impl.h:167: const std::string& method() const { return method_; } On ...
4 years, 7 months ago (2016-05-23 16:25:11 UTC) #18
Łukasz Anforowicz
Camille, can you take another look please?
4 years, 7 months ago (2016-05-26 00:52:02 UTC) #19
clamy
Thanks! A few more comments. https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigation_handle_impl.cc#newcode299 content/browser/frame_host/navigation_handle_impl.cc:299: // Update the navigation ...
4 years, 7 months ago (2016-05-26 15:35:24 UTC) #20
Łukasz Anforowicz
Camille, can you take another look please? https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigation_handle_impl.cc#newcode299 content/browser/frame_host/navigation_handle_impl.cc:299: // Update ...
4 years, 7 months ago (2016-05-26 17:14:02 UTC) #21
clamy
Thanks! https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1956383003/diff/260001/content/browser/frame_host/navigator_impl.cc#newcode733 content/browser/frame_host/navigator_impl.cc:733: SiteIsolationPolicy::AreCrossProcessFramesPossible()); On 2016/05/26 17:14:02, Łukasz Anforowicz wrote: > ...
4 years, 6 months ago (2016-05-30 16:40:43 UTC) #22
Łukasz Anforowicz
Camille, can you take another look please? (I've just kicked off the trybots and haven't ...
4 years, 6 months ago (2016-05-31 16:25:20 UTC) #23
Łukasz Anforowicz
Charlie, I think this CL is really close to being ready for a //content OWNER ...
4 years, 6 months ago (2016-05-31 18:15:20 UTC) #25
Charlie Reis
Nice. And to clarify, this will be enough to get the XSS Auditor to work ...
4 years, 6 months ago (2016-05-31 21:08:36 UTC) #26
Łukasz Anforowicz
On 2016/05/31 21:08:36, Charlie Reis wrote: > And to clarify, this will be enough to ...
4 years, 6 months ago (2016-05-31 22:40:55 UTC) #28
clamy
Thanks! No more comments from me besides creis's, so lgtm. https://codereview.chromium.org/1956383003/diff/360001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1956383003/diff/360001/content/browser/frame_host/navigator_impl.cc#newcode440 ...
4 years, 6 months ago (2016-06-01 13:22:38 UTC) #29
Łukasz Anforowicz
I raised 2 more questions below (man, this CL is sure taking a while to ...
4 years, 6 months ago (2016-06-01 16:28:38 UTC) #30
Charlie Reis
[+scottmg for content/browser/loader/DEPS] Thanks! LGTM with some thoughts below. https://codereview.chromium.org/1956383003/diff/360001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/1956383003/diff/360001/content/browser/frame_host/navigation_handle_impl.cc#newcode314 content/browser/frame_host/navigation_handle_impl.cc:314: ...
4 years, 6 months ago (2016-06-01 23:46:33 UTC) #32
scottmg
https://codereview.chromium.org/1956383003/diff/420001/content/browser/loader/DEPS File content/browser/loader/DEPS (right): https://codereview.chromium.org/1956383003/diff/420001/content/browser/loader/DEPS#newcode232 content/browser/loader/DEPS:232: "+content/common/resource_request_body.h", On 2016/06/01 23:46:32, Charlie Reis wrote: > I'm ...
4 years, 6 months ago (2016-06-02 00:14:33 UTC) #34
Łukasz Anforowicz
scottmg@, PTAL? creis@ - since your l-g-t-m, I've done: - some DCHECK tweaks (i.e. NOTREACHED() ...
4 years, 6 months ago (2016-06-02 22:07:05 UTC) #35
Łukasz Anforowicz
sky@, could you do an OWNERs review for chrome/test/base/ui_test_utils.cc? The change makes the test utils ...
4 years, 6 months ago (2016-06-02 22:09:42 UTC) #37
scottmg
c/b/l/DEPS lgtm
4 years, 6 months ago (2016-06-02 22:12:24 UTC) #38
Charlie Reis
Changes since patch set 22 LGTM.
4 years, 6 months ago (2016-06-02 22:44:30 UTC) #39
sky
chrome/test/base/ui_test_utils.cc LGTM
4 years, 6 months ago (2016-06-02 23:41:22 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1956383003/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1956383003/480001
4 years, 6 months ago (2016-06-03 15:58:49 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/238760)
4 years, 6 months ago (2016-06-03 17:42:05 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1956383003/480001
4 years, 6 months ago (2016-06-03 18:06:06 UTC) #47
commit-bot: I haz the power
Committed patchset #25 (id:480001)
4 years, 6 months ago (2016-06-03 19:38:25 UTC) #48
commit-bot: I haz the power
4 years, 6 months ago (2016-06-03 19:39:31 UTC) #50
Message was sent while issue was closed.
Patchset 25 (id:??) landed as
https://crrev.com/5aa2c3740801f1c148c85db6612c24be0a76b6fe
Cr-Commit-Position: refs/heads/master@{#397779}

Powered by Google App Engine
This is Rietveld 408576698