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

Issue 1896463003: WebUI: Add JavaScript lifecycle-control to WebUIMessageHandler. (Closed)

Created:
4 years, 8 months ago by tommycli
Modified:
3 years, 7 months ago
CC:
asanka, chromium-reviews, darin-cc_chromium.org, dbeam+watch-settings_chromium.org, dbeam+watch-downloads_chromium.org, jam, michaelpg+watch-md-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, Charlie Reis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebUI: Add JavaScript lifecycle-control to WebUIMessageHandler. This patch: 1) Adds AllowJavascript call to WebUIMessageHandler. 2) Adds JavaScript lifecycle callbacks OnJavascriptAllowed and OnJavascriptDisallowed. 3) Adds a CHECKed CallJavascriptFunction method. 4) Updates classes previously using the RenderViewReused method to the new OnJavascriptDisallowed callback. Design doc: https://docs.google.com/a/chromium.org/document/d/1z1diKvwgMmn4YFzlW1kss0yHmo8yy68TN_FUhUzRz7Q/edit?usp=sharing BUG=602523 Committed: https://crrev.com/b0e0efcaf8951d0186ea75c1258c89d9bcb86822 Cr-Commit-Position: refs/heads/master@{#389218}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 14

Patch Set 7 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+186 lines, -121 lines) Patch
M chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler.h View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler.cc View 1 2 3 4 5 6 3 chunks +16 lines, -27 lines 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler_unittest.cc View 1 2 3 4 5 2 chunks +10 lines, -10 lines 0 comments Download
M chrome/browser/ui/webui/settings/font_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/font_handler.cc View 1 2 3 4 5 6 4 chunks +11 lines, -9 lines 0 comments Download
M chrome/browser/ui/webui/settings/profile_info_handler.h View 1 2 3 4 5 6 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/settings/profile_info_handler.cc View 1 2 3 4 5 6 4 chunks +13 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/settings/settings_page_ui_handler.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/settings/settings_startup_pages_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/settings_startup_pages_handler.cc View 1 2 3 4 5 6 3 chunks +22 lines, -23 lines 0 comments Download
M content/browser/webui/web_ui_impl.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/webui/web_ui_impl.cc View 1 2 3 4 5 6 2 chunks +16 lines, -13 lines 0 comments Download
M content/browser/webui/web_ui_message_handler.cc View 1 2 3 4 5 6 2 chunks +22 lines, -0 lines 0 comments Download
M content/public/browser/web_ui.h View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/browser/web_ui_message_handler.h View 1 2 3 4 5 6 6 chunks +45 lines, -5 lines 1 comment Download
M content/public/test/test_web_ui.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_web_ui.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (8 generated)
tommycli
dbeam/jochen: PTAL
4 years, 8 months ago (2016-04-15 23:25:06 UTC) #2
Dan Beam
looking pretty good to me https://codereview.chromium.org/1896463003/diff/100001/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc File chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc (right): https://codereview.chromium.org/1896463003/diff/100001/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc#newcode143 chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc:143: CheckForRemovedFiles(); technically we want ...
4 years, 8 months ago (2016-04-18 23:13:21 UTC) #3
tommycli
dbeam: Thanks! I made some revisions. Tommy https://codereview.chromium.org/1896463003/diff/100001/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc File chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc (right): https://codereview.chromium.org/1896463003/diff/100001/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc#newcode143 chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc:143: CheckForRemovedFiles(); On ...
4 years, 8 months ago (2016-04-19 17:45:38 UTC) #4
Dan Beam
lgtm
4 years, 8 months ago (2016-04-19 21:27:05 UTC) #5
tommycli
dbeam: awesome thanks! jochen: PTAL (design doc in description)
4 years, 8 months ago (2016-04-19 21:54:20 UTC) #6
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-04-20 14:23:38 UTC) #7
tommycli
carlosk: Adding you since you commented on the doc. I wanted to get any feedback ...
4 years, 8 months ago (2016-04-20 16:36:18 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1896463003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1896463003/120001
4 years, 8 months ago (2016-04-20 22:58:01 UTC) #12
carlosk
On 2016/04/20 16:36:18, tommycli wrote: > carlosk: Adding you since you commented on the doc. ...
4 years, 8 months ago (2016-04-21 12:04:04 UTC) #14
Dan Beam
On 2016/04/21 12:04:04, carlosk wrote: > On 2016/04/20 16:36:18, tommycli wrote: > > carlosk: Adding ...
4 years, 8 months ago (2016-04-21 16:47:37 UTC) #15
Dan Beam
/cc creis@ and nasko@ as an FYI
4 years, 8 months ago (2016-04-21 16:49:35 UTC) #16
nasko
On 2016/04/21 16:49:35, Dan Beam wrote: > /cc creis@ and nasko@ as an FYI Thanks ...
4 years, 8 months ago (2016-04-21 17:13:04 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1896463003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1896463003/120001
4 years, 8 months ago (2016-04-22 18:39:13 UTC) #19
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 8 months ago (2016-04-22 19:59:10 UTC) #21
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/b0e0efcaf8951d0186ea75c1258c89d9bcb86822 Cr-Commit-Position: refs/heads/master@{#389218}
4 years, 8 months ago (2016-04-22 20:01:12 UTC) #23
Dan Beam
https://codereview.chromium.org/1896463003/diff/120001/content/public/browser/web_ui_message_handler.h File content/public/browser/web_ui_message_handler.h (right): https://codereview.chromium.org/1896463003/diff/120001/content/public/browser/web_ui_message_handler.h#newcode84 content/public/browser/web_ui_message_handler.h:84: void CallJavascriptFunction(const std::string& function_name, hey, does this HAVE to ...
3 years, 7 months ago (2017-05-18 01:13:10 UTC) #24
tommycli
3 years, 7 months ago (2017-05-19 02:04:17 UTC) #25
Message was sent while issue was closed.
On 2017/05/18 01:13:10, Dan Beam wrote:
>
https://codereview.chromium.org/1896463003/diff/120001/content/public/browser...
> File content/public/browser/web_ui_message_handler.h (right):
> 
>
https://codereview.chromium.org/1896463003/diff/120001/content/public/browser...
> content/public/browser/web_ui_message_handler.h:84: void
> CallJavascriptFunction(const std::string& function_name,
> hey, does this HAVE to be in the .h?

In general, template functions must be defined in the .h file since the
including files need to make new specializations...

However, I think there are tricky ways of avoiding that if you pre-define the
list of specializations. I didn't think it was worth it at the time.

Powered by Google App Engine
This is Rietveld 408576698