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

Issue 1457623004: Serve mojo WebUI resources from the same origin as the WebUI itself. (Closed)

Created:
5 years, 1 month ago by Sam McNally
Modified:
5 years ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, darin (slow to review), James Su, ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Serve mojo WebUI resources from the same origin as the WebUI itself. Currently, mojo resources are served from chrome://mojo and each mojo WebUI controller replaces the WebUIDataSource for that origin with one containing the resource it needs on construction. If a WebUI page's controller (or an equivalent one) was not the last one to be constructed, any requests for mojo bindings for its mojo interfaces will fail. This change fixes this problem by serving the mojo resources from the same origin as the WebUI itself. BUG=557540 Committed: https://crrev.com/7e10653acb8254226f9b3ca5e0233c298c2ffbc3 Cr-Commit-Position: refs/heads/master@{#361275} Committed: https://crrev.com/afd813ed4b6ce7fbaef2ed9dc39802bcd5587c79 Cr-Commit-Position: refs/heads/master@{#362078}

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 1

Patch Set 3 : rebase #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -78 lines) Patch
M chrome/browser/ui/webui/engagement/site_engagement_ui.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/mojo_web_ui_controller.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/mojo_web_ui_controller.cc View 1 chunk +0 lines, -9 lines 0 comments Download
M chrome/browser/ui/webui/omnibox/omnibox_ui.cc View 1 chunk +8 lines, -8 lines 0 comments Download
M content/browser/webui/web_ui_data_source_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/webui/web_ui_data_source_impl.cc View 2 chunks +18 lines, -25 lines 0 comments Download
M content/browser/webui/web_ui_mojo_browsertest.cc View 1 2 3 5 6 7 5 chunks +25 lines, -10 lines 0 comments Download
M content/public/browser/web_ui_data_source.h View 2 chunks +3 lines, -6 lines 0 comments Download
M content/renderer/mojo_context_state.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/mojo_context_state.cc View 1 2 5 chunks +7 lines, -9 lines 0 comments Download
M content/test/data/web_ui_mojo_shell_test.js View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 29 (12 generated)
Sam McNally
5 years, 1 month ago (2015-11-19 05:41:48 UTC) #2
sky
+jam for content (I'm not an owner there) You should also get a security review ...
5 years, 1 month ago (2015-11-19 17:43:38 UTC) #4
jam
I'm not familiar with the mojo-webui code. Scott: can you review since I believe you ...
5 years, 1 month ago (2015-11-20 01:22:13 UTC) #5
sky
On 2015/11/20 01:22:13, jam wrote: > I'm not familiar with the mojo-webui code. Scott: can ...
5 years, 1 month ago (2015-11-20 16:36:47 UTC) #6
Sam McNally
+tsepez for security https://codereview.chromium.org/1457623004/diff/1/content/renderer/web_ui_mojo_context_state.cc File content/renderer/web_ui_mojo_context_state.cc (right): https://codereview.chromium.org/1457623004/diff/1/content/renderer/web_ui_mojo_context_state.cc#newcode138 content/renderer/web_ui_mojo_context_state.cc:138: if (module_prefix_.empty()) On 2015/11/19 17:43:38, sky ...
5 years ago (2015-11-22 23:43:30 UTC) #8
sky
LGTM
5 years ago (2015-11-23 16:11:56 UTC) #9
Tom Sepez
LGTM. I'm a little surprised that you registered the resource under a .mojom extension, rather ...
5 years ago (2015-11-23 17:07:10 UTC) #10
Sam McNally
On 2015/11/23 17:07:10, Tom Sepez wrote: > LGTM. I'm a little surprised that you registered ...
5 years ago (2015-11-23 23:47:14 UTC) #11
jam
rubberstamp lgtm
5 years ago (2015-11-24 00:05:44 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1457623004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1457623004/20001
5 years ago (2015-11-24 06:25:36 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years ago (2015-11-24 07:49:24 UTC) #15
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/7e10653acb8254226f9b3ca5e0233c298c2ffbc3 Cr-Commit-Position: refs/heads/master@{#361275}
5 years ago (2015-11-24 07:50:04 UTC) #16
magjed_chromium
https://codereview.chromium.org/1457623004/diff/20001/content/browser/webui/web_ui_mojo_browsertest.cc File content/browser/webui/web_ui_mojo_browsertest.cc (right): https://codereview.chromium.org/1457623004/diff/20001/content/browser/webui/web_ui_mojo_browsertest.cc#newcode71 content/browser/webui/web_ui_mojo_browsertest.cc:71: CHECK(base::ReadFileToString(path, &contents, std::string::npos)) << id; After your CL, we ...
5 years ago (2015-11-24 08:55:50 UTC) #18
magjed_chromium
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/1467133004/ by magjed@chromium.org. ...
5 years ago (2015-11-24 09:01:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1457623004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1457623004/200001
5 years ago (2015-11-30 01:42:47 UTC) #25
commit-bot: I haz the power
Committed patchset #9 (id:200001)
5 years ago (2015-11-30 01:46:58 UTC) #27
commit-bot: I haz the power
5 years ago (2015-11-30 01:47:48 UTC) #29
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/afd813ed4b6ce7fbaef2ed9dc39802bcd5587c79
Cr-Commit-Position: refs/heads/master@{#362078}

Powered by Google App Engine
This is Rietveld 408576698