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

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed)

Created:
4 years, 6 months ago by Łukasz Anforowicz
Modified:
4 years, 6 months ago
Reviewers:
Ted C, Charlie Reis, boliu, sky
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, tburkard+watch_chromium.org, nasko+codewatch_chromium.org, yzshen+watch_chromium.org, ajwong+watch_chromium.org, ben+mojo_chromium.org, cbentzel+watch_chromium.org, jam, abarth-chromium, darin-cc_chromium.org, loading-reviews_chromium.org, mlamouri+watch-content_chromium.org, Avi (use Gerrit), creis+watch_chromium.org, Peter Beverloo, gavinp+prer_chromium.org, mkwst+moarreviews-shell_chromium.org, jochen+watch_chromium.org, davidben+watch_chromium.org, Aaron Boodman, darin (slow to review), site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Using ResourceRequestBody as the type of HTTP body outside of //content. This CL changes representation of HTTP body used above //content layer. Before this CL, HTTP body was represented by base::RefCountedMemory; after this CL it is represented by a more generic ResourceRequestBody. This lays the foundations for passing an arbitrary HTTP body out of and back into //content via content::OpenURLParams and NavigationController::LoadURLParams. This ability will be used in a later CL to preserve body of HTTP POST for navigations handled via FrameHostMsg_OpenURL IPC message. This CL adjusts names of fields and enum and values to reflect that ResourceRequestBody can now represent not only browser-initiated POST data, but also renderer-initiated POST data. Such change should be safe (since we already track who initiated the navigation in |is_renderer_initiated| field and should make security decisions based on this field). Summary of the changes: - Renamed fields and enum values: - |browser_initiated_post_data| -> |post_data|. - |LOAD_TYPE_BROWSER_INITIATED_HTTP_POST| -> |LOAD_TYPE_HTTP_POST|. - Changed type of |browser_initiated_post_data| aka |post_data|: - |scoped_refptr<base::RefCountedMemory>| -> |scoped_refptr<content::ResourceRequestBody>| - Java byte[] -> ResourceRequestBody Java class that wraps a serialized form of the native content::ResourceRequestBody. - Exposed ability to create ResourceRequestBody out of a byte array - in C++ (used by test code and DoSearchByImageInNewTab) and Java (needed by a public WebView::postUrl API in Android SDK). - Follow-up changes - Removed no longer needed code: NavigationEntryImpl::ConstructBodyFromBrowserInitiatedPostData - Tweaked tests to account for new behavior (most imporatantly - reverse expectations in SendRendererInitiatedRequestUsingPOST test in chrome/browser/ui/browser_navigator_browsertest.cc) - Forwarding post body into LoadURLParams without looking at |is_renderer_initiated| (in chrome/browser/ui/browser_navigator.cc, components/web_contents_delegate_android/web_contents_delegate_android.cc and content/shell/browser/shell.cc). BUG=344348 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/477a5a270598c17e72365572114490ae60e1ef56 Cr-Commit-Position: refs/heads/master@{#400211}

Patch Set 1 #

Patch Set 2 : Rebasing + self-review. #

Patch Set 3 : Java / JNI / Android plumbing. #

Patch Set 4 : Rebasing... #

Total comments: 26

Patch Set 5 : Addressed CR feedback from creis@. #

Total comments: 4

Patch Set 6 : Rebasing + comment tweaks based on latest round of CR feedback from creis@. #

Total comments: 3

Patch Set 7 : Addressed initial CR feedback from tedchoc@. #

Patch Set 8 : Java changes: s/long mNativePtr/byte[] mEncodedNativeForm/g #

Total comments: 2

Patch Set 9 : Comments and tweaks related to extra copying of the POST body. #

Patch Set 10 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+487 lines, -236 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ChromeServiceTabLauncher.java View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/android/tab_android.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/android/tab_android.cc View 1 2 3 4 5 6 chunks +8 lines, -17 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser_navigator.cc View 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/browser/ui/browser_navigator_browsertest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser_navigator_params.h View 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser_navigator_params.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/tab_contents/core_tab_helper.cc View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/test/base/ui_test_utils.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M components/service_tab_launcher/android/java/src/org/chromium/components/service_tab_launcher/ServiceTabLauncher.java View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M components/service_tab_launcher/browser/android/service_tab_launcher.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M components/web_contents_delegate_android/web_contents_delegate_android.cc View 1 2 2 chunks +6 lines, -14 lines 0 comments Download
M content/browser/frame_host/navigation_controller_android.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/navigation_controller_android.cc View 1 2 3 chunks +3 lines, -8 lines 0 comments Download
M content/browser/frame_host/navigation_controller_impl.cc View 1 2 3 4 5 2 chunks +6 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigation_controller_impl_unittest.cc View 1 2 3 4 5 5 chunks +11 lines, -19 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl.h View 1 2 3 4 4 chunks +6 lines, -8 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl.cc View 1 5 chunks +8 lines, -23 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl_unittest.cc View 1 chunk +8 lines, -11 lines 0 comments Download
M content/browser/net/network_errors_listing_ui.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/webui/web_ui_mojo_browsertest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/common/android/common_jni_registrar.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A content/common/android/resource_request_body_android.h View 1 2 3 4 5 6 7 1 chunk +35 lines, -0 lines 0 comments Download
A content/common/android/resource_request_body_android.cc View 1 2 3 4 5 6 7 8 1 chunk +89 lines, -0 lines 0 comments Download
M content/common/page_state_serialization.h View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -0 lines 0 comments Download
M content/common/page_state_serialization.cc View 1 2 3 4 5 6 7 8 5 chunks +79 lines, -45 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_jni.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/LoadUrlParams.java View 1 2 3 4 5 6 7 4 chunks +7 lines, -9 lines 0 comments Download
A content/public/android/java/src/org/chromium/content_public/common/ResourceRequestBody.java View 1 2 3 4 5 6 7 1 chunk +69 lines, -0 lines 0 comments Download
M content/public/browser/navigation_controller.h View 1 2 3 4 5 3 chunks +7 lines, -8 lines 0 comments Download
M content/public/browser/navigation_controller.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M content/public/browser/navigation_entry.h View 1 2 3 4 5 3 chunks +7 lines, -7 lines 0 comments Download
M content/public/browser/page_navigator.h View 2 chunks +2 lines, -5 lines 0 comments Download
M content/public/common/resource_request_body.h View 1 2 3 4 5 1 chunk +35 lines, -8 lines 0 comments Download
M content/public/common/resource_request_body.cc View 1 2 3 4 5 6 7 1 chunk +28 lines, -0 lines 0 comments Download
M content/shell/browser/shell.cc View 1 2 3 4 5 1 chunk +3 lines, -6 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 42 (15 generated)
Łukasz Anforowicz
Charlie, can you take a look please?
4 years, 6 months ago (2016-06-09 16:11:53 UTC) #7
Łukasz Anforowicz
+site-isolation-reviews@chromium.org
4 years, 6 months ago (2016-06-09 16:26:49 UTC) #8
Charlie Reis
Thanks! LGTM with some minor comments below. https://codereview.chromium.org/2038233002/diff/60001/chrome/browser/ui/browser_navigator_browsertest.cc File chrome/browser/ui/browser_navigator_browsertest.cc (right): https://codereview.chromium.org/2038233002/diff/60001/chrome/browser/ui/browser_navigator_browsertest.cc#newcode1425 chrome/browser/ui/browser_navigator_browsertest.cc:1425: EXPECT_EQ(expected_title, title); ...
4 years, 6 months ago (2016-06-09 22:38:16 UTC) #9
Łukasz Anforowicz
Charlie, can you take another look? I think I've addressed all of your comments, but ...
4 years, 6 months ago (2016-06-10 19:20:50 UTC) #10
Charlie Reis
Thanks-- still LGTM with a few minor nits. https://codereview.chromium.org/2038233002/diff/60001/content/browser/frame_host/navigation_controller_impl.cc File content/browser/frame_host/navigation_controller_impl.cc (right): https://codereview.chromium.org/2038233002/diff/60001/content/browser/frame_host/navigation_controller_impl.cc#newcode675 content/browser/frame_host/navigation_controller_impl.cc:675: NOTREACHED() ...
4 years, 6 months ago (2016-06-10 20:59:28 UTC) #11
Łukasz Anforowicz
Ted, could you please take a look at the Java / JNI / Android parts? ...
4 years, 6 months ago (2016-06-13 18:01:11 UTC) #13
Ted C
Adding boliu for his recent thoughts on gc sore spots in Android land https://codereview.chromium.org/2038233002/diff/100001/content/public/android/java/src/org/chromium/content_public/common/ResourceRequestBody.java File ...
4 years, 6 months ago (2016-06-13 23:49:14 UTC) #14
Łukasz Anforowicz
+boliu for real :-) Thanks for the comments. I have some C# experience (i.e. I ...
4 years, 6 months ago (2016-06-14 00:37:52 UTC) #16
boliu
There are basically 3 designs: 1) gc-based resource clean up, ie finalizer main issue here ...
4 years, 6 months ago (2016-06-14 04:07:59 UTC) #17
Łukasz Anforowicz
Thanks for the quick reply. I'll try to switch to approach #2 (serialization/deserialization at the ...
4 years, 6 months ago (2016-06-14 16:30:09 UTC) #18
boliu
On 2016/06/14 16:30:09, Łukasz Anforowicz wrote: > Thanks for the quick reply. I'll try to ...
4 years, 6 months ago (2016-06-14 18:37:17 UTC) #19
Łukasz Anforowicz
boliu@, can you take another look please? On 2016/06/14 18:37:17, boliu wrote: > On 2016/06/14 ...
4 years, 6 months ago (2016-06-14 21:49:55 UTC) #20
boliu
I was only pulled in for the finalizer discussion. Leave it to owners to review ...
4 years, 6 months ago (2016-06-14 23:54:21 UTC) #21
Łukasz Anforowicz
Ted, can you take a look please? On 2016/06/14 23:54:21, boliu wrote: > I was ...
4 years, 6 months ago (2016-06-15 16:58:43 UTC) #22
boliu
> At any rate - I can leave a TODO, but in CreateResourceRequestBodyFromBytes (which makes ...
4 years, 6 months ago (2016-06-15 17:07:42 UTC) #23
Łukasz Anforowicz
On 2016/06/15 17:07:42, boliu wrote: > > At any rate - I can leave a ...
4 years, 6 months ago (2016-06-15 21:44:02 UTC) #24
Ted C
On 2016/06/15 21:44:02, Łukasz Anforowicz wrote: > On 2016/06/15 17:07:42, boliu wrote: > > > ...
4 years, 6 months ago (2016-06-15 23:04:57 UTC) #26
Łukasz Anforowicz
boliu@, could you please do an OWNERS review for android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java? (and also don't hesitate to ...
4 years, 6 months ago (2016-06-15 23:17:15 UTC) #27
boliu
nah, I trust ted, android_webview lgtm > - 6 copies in current CL. Ahh... so ...
4 years, 6 months ago (2016-06-16 00:02:08 UTC) #28
Łukasz Anforowicz
sky@, could you please do an OWNERS review for the remaining files?: chrome/browser/prerender/prerender_browsertest.cc chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator_browsertest.cc ...
4 years, 6 months ago (2016-06-16 00:13:05 UTC) #30
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038233002/180001
4 years, 6 months ago (2016-06-16 15:28:14 UTC) #32
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-16 16:22:29 UTC) #34
sky
LGTM
4 years, 6 months ago (2016-06-16 16:58:20 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038233002/180001
4 years, 6 months ago (2016-06-16 18:21:40 UTC) #38
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 6 months ago (2016-06-16 18:28:58 UTC) #39
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-16 18:29:12 UTC) #40
commit-bot: I haz the power
4 years, 6 months ago (2016-06-16 18:31:02 UTC) #42
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/477a5a270598c17e72365572114490ae60e1ef56
Cr-Commit-Position: refs/heads/master@{#400211}

Powered by Google App Engine
This is Rietveld 408576698