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

Issue 2275513002: Support having javascript return dictionaries. (Closed)

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

Description

Support having javascript return dictionaries. BUG=None Committed: https://crrev.com/047b06f0b384ff843f2c81d453cb81bfaed2f056 Cr-Commit-Position: refs/heads/master@{#413725}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed comments. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -0 lines) Patch
M ios/web/web_state/ui/web_view_js_utils.mm View 1 2 chunks +11 lines, -0 lines 6 comments Download
M ios/web/web_state/ui/web_view_js_utils_unittest.mm View 1 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (9 generated)
jif
ptal
4 years, 4 months ago (2016-08-23 12:08:02 UTC) #4
marq (ping after 24h)
LGTM with nits. https://codereview.chromium.org/2275513002/diff/1/ios/web/web_state/ui/web_view_js_utils.mm File ios/web/web_state/ui/web_view_js_utils.mm (right): https://codereview.chromium.org/2275513002/diff/1/ios/web/web_state/ui/web_view_js_utils.mm#newcode67 ios/web/web_state/ui/web_view_js_utils.mm:67: std::unique_ptr<base::DictionaryValue> dictionnary = Spelling: "dictionary". https://codereview.chromium.org/2275513002/diff/1/ios/web/web_state/ui/web_view_js_utils_unittest.mm ...
4 years, 4 months ago (2016-08-23 12:28:26 UTC) #5
jif
Thanks. https://codereview.chromium.org/2275513002/diff/1/ios/web/web_state/ui/web_view_js_utils.mm File ios/web/web_state/ui/web_view_js_utils.mm (right): https://codereview.chromium.org/2275513002/diff/1/ios/web/web_state/ui/web_view_js_utils.mm#newcode67 ios/web/web_state/ui/web_view_js_utils.mm:67: std::unique_ptr<base::DictionaryValue> dictionnary = On 2016/08/23 12:28:26, marq wrote: ...
4 years, 4 months ago (2016-08-23 12:59:12 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2275513002/20001
4 years, 4 months ago (2016-08-23 12:59:35 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-08-23 13:53:50 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/047b06f0b384ff843f2c81d453cb81bfaed2f056 Cr-Commit-Position: refs/heads/master@{#413725}
4 years, 4 months ago (2016-08-23 13:55:09 UTC) #13
Eugene But (OOO till 7-30)
What was the purpose of this CL? The description does not explain anything and there ...
4 years, 3 months ago (2016-09-09 15:26:21 UTC) #15
jif-google
The purpose of this CL was to be able to write (downstream) a helper that ...
4 years, 3 months ago (2016-09-09 17:54:45 UTC) #17
Eugene But (OOO till 7-30)
4 years, 3 months ago (2016-09-09 18:28:57 UTC) #18
Message was sent while issue was closed.
Thanks! So since this is needed only for EG test, we could simply use different
API (left suggestion in a bug).

https://codereview.chromium.org/2275513002/diff/20001/ios/web/web_state/ui/we...
File ios/web/web_state/ui/web_view_js_utils.mm (right):

https://codereview.chromium.org/2275513002/diff/20001/ios/web/web_state/ui/we...
ios/web/web_state/ui/web_view_js_utils.mm:71: const std::string& path([key
UTF8String]);
On 2016/09/09 17:54:45, jif-google wrote:
> On 2016/09/09 15:26:21, Eugene But wrote:
> > Please use sys_string_conversions instead of |UTF8String|.
> 
> Acknowledged.
[key UTF8String] may return nil, which will crash the app. Using
sys_string_conversions is not just nice to have thing, it's a question of
correctness.

https://codereview.chromium.org/2275513002/diff/20001/ios/web/web_state/ui/we...
ios/web/web_state/ui/web_view_js_utils.mm:73: ValueResultFromWKResult([wk_result
objectForKey:key]));
On 2016/09/09 17:54:45, jif-google wrote:
> On 2016/09/09 15:26:21, Eugene But wrote:
> > This JSON is coming from internet, which means that it can be almost
> infinitely
> > deep and cause stack overflow.
> 
> When does the JSON come from the internet?
wk_result is the result of script evaluation, for example a result of __crWeb
function call. Web pages can easily override those calls and provide a
dictionary which can overflow the stack.

Powered by Google App Engine
This is Rietveld 408576698