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

Issue 226043005: Fix webview.executeScript API (Closed)

Created:
6 years, 8 months ago by Xi Han
Modified:
6 years, 8 months ago
CC:
Fady Samuel, chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Fix a bug in the API webview.executeScript. After this fix, if the webview (who calls the executeScript API) is navigated to another source, the executeScript API won't be injected and executed in the new source. BUG=239388 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=263020

Patch Set 1 #

Total comments: 8

Patch Set 2 : Small changes are made. #

Total comments: 14

Patch Set 3 : Make use of GURL. #

Total comments: 12

Patch Set 4 : Add check for invalid url. #

Total comments: 2

Patch Set 5 : Update return value. #

Patch Set 6 : Finial version after solving conflicts #

Patch Set 7 : Update InsertCss API. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -39 lines) Patch
M chrome/browser/apps/web_view_browsertest.cc View 2 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/execute_code_function.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/execute_code_function.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 2 3 4 5 6 2 chunks +17 lines, -13 lines 0 comments Download
M chrome/browser/extensions/api/webview/webview_api.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/webview/webview_api.cc View 1 2 3 4 5 6 3 chunks +14 lines, -3 lines 0 comments Download
M chrome/browser/extensions/script_executor.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/script_executor.cc View 1 2 2 chunks +13 lines, -12 lines 0 comments Download
M chrome/common/extensions/api/webview.json View 1 2 3 4 5 6 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/user_script_scheduler.cc View 1 2 3 4 5 6 1 chunk +12 lines, -8 lines 0 comments Download
M chrome/renderer/resources/extensions/web_view.js View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/shim/main.js View 1 2 2 chunks +34 lines, -0 lines 0 comments Download
M extensions/common/extension_messages.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
Xi Han
6 years, 8 months ago (2014-04-04 19:17:20 UTC) #1
Fady Samuel
This looks great! Please specify the bug in BUG= https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/webview/webview_api.cc#newcode304 chrome/browser/extensions/api/webview/webview_api.cc:304: ...
6 years, 8 months ago (2014-04-04 19:35:05 UTC) #2
Xi Han
I have no idea why the related tests on all test servers failed, and I ...
6 years, 8 months ago (2014-04-06 20:14:03 UTC) #3
Fady Samuel
One nit, but otherwise lgtm! https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc File chrome/browser/extensions/api/tabs/tabs_api.cc (right): https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc#newcode1377 chrome/browser/extensions/api/tabs/tabs_api.cc:1377: "", std::string(),
6 years, 8 months ago (2014-04-07 14:03:10 UTC) #4
Xi Han
Upload changes for review. https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc File chrome/browser/extensions/api/tabs/tabs_api.cc (right): https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc#newcode1377 chrome/browser/extensions/api/tabs/tabs_api.cc:1377: "", On 2014/04/07 14:03:10, Fady ...
6 years, 8 months ago (2014-04-07 14:58:09 UTC) #5
not at google - send to devlin
main comment is around use of GURL. https://codereview.chromium.org/226043005/diff/20001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/20001/chrome/browser/extensions/api/webview/webview_api.cc#newcode271 chrome/browser/extensions/api/webview/webview_api.cc:271: } make ...
6 years, 8 months ago (2014-04-07 17:43:00 UTC) #6
not at google - send to devlin
that said, one reason to use a std::string is because the src= might be an ...
6 years, 8 months ago (2014-04-07 17:44:17 UTC) #7
Fady Samuel
https://codereview.chromium.org/226043005/diff/20001/chrome/common/extensions/api/webview.json File chrome/common/extensions/api/webview.json (right): https://codereview.chromium.org/226043005/diff/20001/chrome/common/extensions/api/webview.json#newcode332 chrome/common/extensions/api/webview.json:332: "description": "The src of the guest <webview> process." On ...
6 years, 8 months ago (2014-04-07 17:49:31 UTC) #8
Fady Samuel
https://codereview.chromium.org/226043005/diff/20001/chrome/common/extensions/api/webview.json File chrome/common/extensions/api/webview.json (right): https://codereview.chromium.org/226043005/diff/20001/chrome/common/extensions/api/webview.json#newcode332 chrome/common/extensions/api/webview.json:332: "description": "The src of the guest <webview> process." On ...
6 years, 8 months ago (2014-04-07 17:49:31 UTC) #9
Xi Han
6 years, 8 months ago (2014-04-07 20:38:02 UTC) #10
Fady Samuel
Check if it's invalid. https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc#newcode272 chrome/browser/extensions/api/webview/webview_api.cc:272: if (guest_src_.is_empty()) if (guest_src_.is_empty() || ...
6 years, 8 months ago (2014-04-07 20:39:34 UTC) #11
not at google - send to devlin
please mark things as Done when you do them so I know to have another ...
6 years, 8 months ago (2014-04-07 20:43:17 UTC) #12
Fady Samuel
https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc#newcode272 chrome/browser/extensions/api/webview/webview_api.cc:272: if (guest_src_.is_empty()) On 2014/04/07 20:43:18, kalman wrote: > On ...
6 years, 8 months ago (2014-04-07 20:44:11 UTC) #13
not at google - send to devlin
please fix that is_valid thing, but other than that, lgtm. https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/40001/chrome/browser/extensions/api/webview/webview_api.cc#newcode272 ...
6 years, 8 months ago (2014-04-07 21:00:07 UTC) #14
Xi Han
Sorry, I will mark things done. On 2014/04/07 20:43:17, kalman wrote: > please mark things ...
6 years, 8 months ago (2014-04-07 21:00:35 UTC) #15
Xi Han
https://codereview.chromium.org/226043005/diff/20001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/20001/chrome/browser/extensions/api/webview/webview_api.cc#newcode271 chrome/browser/extensions/api/webview/webview_api.cc:271: } On 2014/04/07 17:43:00, kalman wrote: > make braces ...
6 years, 8 months ago (2014-04-07 21:03:36 UTC) #16
Xi Han
https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc File chrome/browser/extensions/api/tabs/tabs_api.cc (right): https://codereview.chromium.org/226043005/diff/1/chrome/browser/extensions/api/tabs/tabs_api.cc#newcode1377 chrome/browser/extensions/api/tabs/tabs_api.cc:1377: "", On 2014/04/07 14:03:10, Fady Samuel wrote: > std::string(), ...
6 years, 8 months ago (2014-04-07 21:09:43 UTC) #17
Fady Samuel
https://codereview.chromium.org/226043005/diff/60001/chrome/browser/extensions/api/webview/webview_api.cc File chrome/browser/extensions/api/webview/webview_api.cc (right): https://codereview.chromium.org/226043005/diff/60001/chrome/browser/extensions/api/webview/webview_api.cc#newcode307 chrome/browser/extensions/api/webview/webview_api.cc:307: GURL WebviewExecuteCodeFunction::GetWebViewSrc() const { return guest_src_; } You can ...
6 years, 8 months ago (2014-04-07 21:10:45 UTC) #18
Xi Han
Update the three places where GetWebViewSrc() are declared: -execute_code_function.h -webview_api.h -tabs_api.h Two places it is ...
6 years, 8 months ago (2014-04-07 21:42:15 UTC) #19
Fady Samuel
lgtm
6 years, 8 months ago (2014-04-07 21:44:10 UTC) #20
Xi Han
Could you please review the extension_message.h file? Thank you.
6 years, 8 months ago (2014-04-08 17:00:15 UTC) #21
Xi Han
Hello Kalman, Could you please take a final look at the code updates? I uploaded ...
6 years, 8 months ago (2014-04-08 18:27:23 UTC) #22
kenrb
lgtm for the IPC change.
6 years, 8 months ago (2014-04-08 19:02:14 UTC) #23
not at google - send to devlin
lgtm
6 years, 8 months ago (2014-04-08 20:01:48 UTC) #24
Xi Han
The CQ bit was checked by hanxi@chromium.org
6 years, 8 months ago (2014-04-08 20:17:18 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hanxi@chromium.org/226043005/80001
6 years, 8 months ago (2014-04-08 20:18:11 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-08 20:18:24 UTC) #27
commit-bot: I haz the power
Failed to apply patch for chrome/renderer/extensions/user_script_scheduler.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-04-08 20:18:25 UTC) #28
Xi Han
Updates cl after solving conflicts
6 years, 8 months ago (2014-04-08 21:06:33 UTC) #29
Xi Han
The CQ bit was checked by hanxi@chromium.org
6 years, 8 months ago (2014-04-08 21:06:40 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hanxi@chromium.org/226043005/100001
6 years, 8 months ago (2014-04-08 21:08:07 UTC) #31
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-08 22:04:26 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 8 months ago (2014-04-08 22:04:27 UTC) #33
Xi Han
The CQ bit was checked by hanxi@chromium.org
6 years, 8 months ago (2014-04-10 14:55:25 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hanxi@chromium.org/226043005/140001
6 years, 8 months ago (2014-04-10 14:55:28 UTC) #35
commit-bot: I haz the power
6 years, 8 months ago (2014-04-10 17:12:54 UTC) #36
Message was sent while issue was closed.
Change committed as 263020

Powered by Google App Engine
This is Rietveld 408576698