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

Issue 1375023002: Adds support for POST request with bodies on WKWebView. (Closed)

Created:
5 years, 2 months ago by stkhapugin
Modified:
5 years ago
CC:
chromium-reviews, bzanotti
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds support for POST request with bodies on WKWebView. These requests are now handled through a javascript hack to work around this webkit bug: https://bugs.webkit.org/show_bug.cgi?id=145410. BUG=489692 Committed: https://crrev.com/8d13d52f53c03f6b78ab8fbf7148155780063244 Cr-Commit-Position: refs/heads/master@{#363256}

Patch Set 1 #

Patch Set 2 : Missing javascript #

Total comments: 58

Patch Set 3 : comments-1 #

Patch Set 4 : formatting #

Patch Set 5 : formatting #

Patch Set 6 : other comments addressed #

Patch Set 7 : Escaping characters for JavaScript #

Patch Set 8 : Formatting #

Total comments: 8

Patch Set 9 : Some comments addressed #

Patch Set 10 : fix + formatting #

Patch Set 11 : styling #

Patch Set 12 : formatting and renaming #

Patch Set 13 : missing files #

Patch Set 14 : rest of the commetns #

Total comments: 38

Patch Set 15 : sync commit #

Patch Set 16 : Added unit test and error handling; Synced. #

Patch Set 17 : missing file #

Total comments: 62

Patch Set 18 : All comments addressed #

Total comments: 40

Patch Set 19 : Another round of comments #

Total comments: 6

Patch Set 20 : Another round of comments #

Patch Set 21 : more comments #

Patch Set 22 : Xcode has reverted my changes and I'm reapplying #

Total comments: 17

Patch Set 23 : s/BOOL/bool #

Patch Set 24 : Fixed leaking WKWV #

Patch Set 25 : Styling #

Patch Set 26 : Addressed Noyau's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+447 lines, -9 lines) Patch
M ios/web/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -0 lines 0 comments Download
M ios/web/ios_web.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -0 lines 0 comments Download
M ios/web/ios_web_unittests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
A ios/web/web_state/js/crw_js_post_request_loader.h 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 1 chunk +28 lines, -0 lines 0 comments Download
A ios/web/web_state/js/crw_js_post_request_loader.mm 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 25 1 chunk +156 lines, -0 lines 0 comments Download
A ios/web/web_state/js/crw_js_post_request_loader_unittest.mm 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 25 1 chunk +105 lines, -0 lines 0 comments Download
A ios/web/web_state/js/resources/post_request.js 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 25 1 chunk +84 lines, -0 lines 0 comments Download
M ios/web/web_state/ui/crw_wk_script_message_router.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +5 lines, -1 line 0 comments Download
M ios/web/web_state/ui/crw_wk_web_view_web_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +61 lines, -8 lines 0 comments Download

Messages

Total messages: 47 (15 generated)
stkhapugin
This is not perfect, but it works. The fix is inspired by https://code.google.com/p/chromium/codesearch#chromium/src/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm&l=41 and the ...
5 years, 2 months ago (2015-09-29 17:18:13 UTC) #2
Eugene But (OOO till 7-30)
Nice :) https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode61 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:61: // load the resource because of 302s ...
5 years, 2 months ago (2015-09-29 17:46:46 UTC) #3
stuartmorgan
https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode125 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:125: [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; On 2015/09/29 17:46:46, eugenebut wrote: ...
5 years, 2 months ago (2015-09-29 21:24:45 UTC) #4
bzanotti
https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode513 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:513: [headerString appendFormat:@"req.setRequestHeader(\"%@\", \"%@\");", There might be some escaping required ...
5 years, 2 months ago (2015-09-30 09:06:54 UTC) #6
stkhapugin
Thanks for comments, I addressed them. PTAL https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode61 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:61: // load ...
5 years, 2 months ago (2015-09-30 15:05:14 UTC) #7
Eugene But (OOO till 7-30)
lgtm with changes below. Stuart will finish the review. https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode71 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:71: ...
5 years, 2 months ago (2015-09-30 15:45:17 UTC) #8
stuartmorgan
https://codereview.chromium.org/1375023002/diff/140001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/140001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode60 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:60: return base::SysUTF8ToNSString(base::GetQuotedJSONString(string)); The round-tripping of what's going to be ...
5 years, 2 months ago (2015-10-01 23:36:27 UTC) #9
stkhapugin
Please take another look. https://codereview.chromium.org/1375023002/diff/140001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/140001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode60 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:60: return base::SysUTF8ToNSString(base::GetQuotedJSONString(string)); On 2015/10/01 at ...
5 years, 2 months ago (2015-10-08 16:57:24 UTC) #10
Eugene But (OOO till 7-30)
https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode585 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:585: ProceduralBlock POSTBlock = ^{ On 2015/09/30 15:45:16, eugenebut wrote: ...
5 years, 2 months ago (2015-10-08 17:46:33 UTC) #11
stuartmorgan
https://codereview.chromium.org/1375023002/diff/260001/ios/web/web_state/js/crw_js_post_request_loader.mm File ios/web/web_state/js/crw_js_post_request_loader.mm (right): https://codereview.chromium.org/1375023002/diff/260001/ios/web/web_state/js/crw_js_post_request_loader.mm#newcode24 ios/web/web_state/js/crw_js_post_request_loader.mm:24: NSString* js = web::GetPageScript(@"post_request"); How long does this take ...
5 years, 2 months ago (2015-10-08 19:11:29 UTC) #12
stkhapugin
On 2015/10/08 19:11:29, stuartmorgan wrote: > More generally, what exactly does happen if, e.g., a ...
5 years, 1 month ago (2015-11-10 13:41:12 UTC) #13
stuartmorgan
A JS message with a handler sounds reasonable, yes. It should *definitely* not call a ...
5 years, 1 month ago (2015-11-11 00:15:53 UTC) #14
stkhapugin
Please take another look.
5 years ago (2015-12-02 15:46:11 UTC) #15
Eugene But (OOO till 7-30)
Please reply to comments fro previous round. https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm File ios/web/web_state/ui/crw_wk_web_view_web_controller.mm (right): https://codereview.chromium.org/1375023002/diff/20001/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm#newcode527 ios/web/web_state/ui/crw_wk_web_view_web_controller.mm:527: // expected ...
5 years ago (2015-12-02 17:06:16 UTC) #16
stkhapugin
PTAL. I believe I addressed all the comments except "http" error domain where I need ...
5 years ago (2015-12-03 15:43:03 UTC) #17
Eugene But (OOO till 7-30)
https://codereview.chromium.org/1375023002/diff/320001/ios/web/web_state/js/crw_js_post_request_loader.mm File ios/web/web_state/js/crw_js_post_request_loader.mm (right): https://codereview.chromium.org/1375023002/diff/320001/ios/web/web_state/js/crw_js_post_request_loader.mm#newcode88 ios/web/web_state/js/crw_js_post_request_loader.mm:88: // during its execution otherwise. On 2015/12/03 15:43:02, stkhapugin ...
5 years ago (2015-12-03 16:51:43 UTC) #18
stkhapugin
PTAL. Eugene, thanks for your patience and thorough comments! https://codereview.chromium.org/1375023002/diff/320001/ios/web/web_state/js/crw_js_post_request_loader.mm File ios/web/web_state/js/crw_js_post_request_loader.mm (right): https://codereview.chromium.org/1375023002/diff/320001/ios/web/web_state/js/crw_js_post_request_loader.mm#newcode88 ios/web/web_state/js/crw_js_post_request_loader.mm:88: ...
5 years ago (2015-12-03 17:51:03 UTC) #19
Eugene But (OOO till 7-30)
Thank you for patience and making changes. lgtm modulo comments below. https://codereview.chromium.org/1375023002/diff/320001/ios/web/web_state/js/crw_js_post_request_loader.mm File ios/web/web_state/js/crw_js_post_request_loader.mm (right): ...
5 years ago (2015-12-03 18:13:21 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1375023002/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1375023002/420001
5 years ago (2015-12-04 11:49:56 UTC) #22
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/144811)
5 years ago (2015-12-04 12:01:27 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1375023002/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1375023002/440001
5 years ago (2015-12-04 12:10:26 UTC) #26
noyau (Ping after 24h)
https://codereview.chromium.org/1375023002/diff/420001/ios/web/web_state/js/crw_js_post_request_loader.h File ios/web/web_state/js/crw_js_post_request_loader.h (right): https://codereview.chromium.org/1375023002/diff/420001/ios/web/web_state/js/crw_js_post_request_loader.h#newcode19 ios/web/web_state/js/crw_js_post_request_loader.h:19: // The |completionHandler| must not be null. Neither is ...
5 years ago (2015-12-04 12:19:19 UTC) #28
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/103046)
5 years ago (2015-12-04 12:40:42 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/1375023002/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1375023002/460001
5 years ago (2015-12-04 14:38:48 UTC) #32
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/103104)
5 years ago (2015-12-04 15:12:27 UTC) #34
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1375023002/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1375023002/500001
5 years ago (2015-12-04 16:27:16 UTC) #36
stkhapugin
PTAL. Eric, I've done things you requested. Eugene, I addressed your comments. Non-stylistic changes since ...
5 years ago (2015-12-04 16:28:10 UTC) #37
noyau (Ping after 24h)
lgtm https://codereview.chromium.org/1375023002/diff/420001/ios/web/web_state/js/crw_js_post_request_loader.mm File ios/web/web_state/js/crw_js_post_request_loader.mm (right): https://codereview.chromium.org/1375023002/diff/420001/ios/web/web_state/js/crw_js_post_request_loader.mm#newcode66 ios/web/web_state/js/crw_js_post_request_loader.mm:66: } On 2015/12/04 16:28:10, stkhapugin wrote: > On ...
5 years ago (2015-12-04 17:22:02 UTC) #38
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/150398)
5 years ago (2015-12-04 18:00:43 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1375023002/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1375023002/500001
5 years ago (2015-12-04 18:16:28 UTC) #43
commit-bot: I haz the power
Committed patchset #26 (id:500001)
5 years ago (2015-12-04 18:46:08 UTC) #45
commit-bot: I haz the power
5 years ago (2015-12-04 18:47:14 UTC) #47
Message was sent while issue was closed.
Patchset 26 (id:??) landed as
https://crrev.com/8d13d52f53c03f6b78ab8fbf7148155780063244
Cr-Commit-Position: refs/heads/master@{#363256}

Powered by Google App Engine
This is Rietveld 408576698