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 2646003002: [ios] Remove the openJavascript method from Tab. (Closed)

Created:
3 years, 11 months ago by rohitrao (ping after 24h)
Modified:
3 years, 11 months ago
CC:
chromium-reviews, marq+watch_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[ios] Remove the openJavascript method from Tab. Moves the implementation up into BrowserViewController, which is the only caller. BVC now processes the input JS lightly and then calls WebState::ExecuteJavascript() directly. BUG=681867 Review-Url: https://codereview.chromium.org/2646003002 Cr-Commit-Position: refs/heads/master@{#445068} Committed: https://chromium.googlesource.com/chromium/src/+/746baec6650e544f81bc8a7def3b13da13fbef51

Patch Set 1 #

Total comments: 8

Patch Set 2 : Review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -11 lines) Patch
M ios/chrome/browser/tabs/tab.h View 1 chunk +0 lines, -3 lines 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 1 chunk +0 lines, -7 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 16 (10 generated)
rohitrao (ping after 24h)
Can this code live somewhere other than BVC? If we can get rid of the ...
3 years, 11 months ago (2017-01-19 21:59:09 UTC) #4
Eugene But (OOO till 7-30)
lgtm https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/browser_view_controller.mm File ios/chrome/browser/ui/browser_view_controller.mm (right): https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/browser_view_controller.mm#newcode3791 ios/chrome/browser/ui/browser_view_controller.mm:3791: javascript = [javascript stringByRemovingPercentEncoding]; On 2017/01/19 21:59:09, rohitrao ...
3 years, 11 months ago (2017-01-19 22:20:34 UTC) #8
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/2646003002/20001
3 years, 11 months ago (2017-01-20 16:11:40 UTC) #11
rohitrao (ping after 24h)
https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/browser_view_controller.mm File ios/chrome/browser/ui/browser_view_controller.mm (right): https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/browser_view_controller.mm#newcode3792 ios/chrome/browser/ui/browser_view_controller.mm:3792: web::WebState* web_state = [[_model currentTab] webState]; On 2017/01/19 22:20:34, ...
3 years, 11 months ago (2017-01-20 16:12:17 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/746baec6650e544f81bc8a7def3b13da13fbef51
3 years, 11 months ago (2017-01-20 16:21:25 UTC) #15
Eugene But (OOO till 7-30)
3 years, 11 months ago (2017-01-20 18:05:18 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/brows...
File ios/chrome/browser/ui/browser_view_controller.mm (right):

https://codereview.chromium.org/2646003002/diff/1/ios/chrome/browser/ui/brows...
ios/chrome/browser/ui/browser_view_controller.mm:3794:
web_state->ExecuteJavaScript(base::SysNSStringToUTF16(javascript));
On 2017/01/20 16:12:17, rohitrao wrote:
> On 2017/01/19 22:20:33, Eugene But wrote:
> > On 2017/01/19 21:59:09, rohitrao wrote:
> > > This is a little dumb because we go from UTF8 -> NSString -> UTF16 ->
> NSString
> > > =)  I can probably remove one of those conversions.
> > This is user supplied JS. I don't think they can type so much code to cause
a
> > performance problem :)
> 
> This is not actually true.  The JS supplied here comes from links in the page,
> so they can probably be arbitrarily large.
So maybe we should change WebState::ExecuteJavaScript to take NSString? I
created this method with sting16 signature to match content API, but in this
case it looks like diverging is reasonable.

Powered by Google App Engine
This is Rietveld 408576698