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

Issue 1312653003: Fix for WebView accessible resources. (Closed)

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

Description

This patch allows the webview.partitions.accessible_resources entry in chrome app manifests to work fully as intended. Previously, web pages attempting to use resources specified as webview accessible would fail to load those resources. This happened because a check in the renderer would stop the resource request from being made before the request ever reached the browser process where the webview accessible resources are checked in the manifest. This patch corrects this problem by propagating webview partition IDs to webview guest renderer processes, so that they can check the correct entry in the manifest for accessible resources and allow valid requests to go through to the browser process. BUG=460797 Committed: https://crrev.com/ad727fc6c70d04cdd0a9a7d14c4aa68b4c0e8e72 Cr-Commit-Position: refs/heads/master@{#347936}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Addressed comments by lfg@. #

Total comments: 8

Patch Set 3 : Addressed comments by kalman@. #

Total comments: 22

Patch Set 4 : Addressed comments by kalman@. #

Total comments: 10

Patch Set 5 : Addressed comments by kalman@. #

Total comments: 20

Patch Set 6 : Addressed comments by kalman@, Added test. #

Patch Set 7 : Removed WebviewInfo::Get(). #

Patch Set 8 : Small fix. Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -127 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/plugins/plugin_info_message_filter.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -12 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_webview_accessible_resources_unittest.cc View 1 2 3 4 5 6 7 1 chunk +35 lines, -54 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/renderer/extensions/resource_request_policy.h View 1 2 3 4 1 chunk +13 lines, -6 lines 0 comments Download
M chrome/renderer/extensions/resource_request_policy.cc View 1 2 3 4 5 6 chunks +15 lines, -13 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/assets/test.bmp View 1 2 3 4 5 Binary file 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/background.js View 1 2 3 4 5 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/embedder.html View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/embedder.js View 1 2 3 4 5 1 chunk +43 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/guest.html View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/load_webview_accessible_resource/manifest.json View 1 2 3 4 5 1 chunk +23 lines, -0 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_guest.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_guest.cc View 1 2 3 4 5 6 7 5 chunks +16 lines, -2 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_renderer_state.h View 1 2 3 4 5 3 chunks +12 lines, -10 lines 0 comments Download
M extensions/browser/renderer_startup_helper.cc View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M extensions/browser/url_request_util.cc View 1 2 3 4 5 2 chunks +5 lines, -9 lines 0 comments Download
M extensions/common/extension_messages.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
M extensions/common/manifest_handlers/webview_info.h View 1 2 3 4 5 6 1 chunk +6 lines, -6 lines 0 comments Download
M extensions/common/manifest_handlers/webview_info.cc View 1 2 3 4 5 6 1 chunk +8 lines, -6 lines 0 comments Download
M extensions/renderer/dispatcher.h View 1 2 3 4 5 6 7 3 chunks +8 lines, -0 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 6 7 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (14 generated)
lfg
Some comments. https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc File chrome/renderer/extensions/resource_request_policy.cc (right): https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc#newcode73 chrome/renderer/extensions/resource_request_policy.cc:73: return true; I think this is probably ...
5 years, 3 months ago (2015-08-26 16:44:38 UTC) #2
paulmeyer
PTAL https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc File chrome/renderer/extensions/resource_request_policy.cc (right): https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc#newcode73 chrome/renderer/extensions/resource_request_policy.cc:73: return true; On 2015/08/26 16:44:38, lfg wrote: > ...
5 years, 3 months ago (2015-08-27 17:28:48 UTC) #3
lfg
lgtm https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc File chrome/renderer/extensions/resource_request_policy.cc (right): https://codereview.chromium.org/1312653003/diff/1/chrome/renderer/extensions/resource_request_policy.cc#newcode73 chrome/renderer/extensions/resource_request_policy.cc:73: return true; On 2015/08/27 17:28:48, Paul Meyer wrote: ...
5 years, 3 months ago (2015-08-27 17:31:46 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1312653003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1312653003/20001
5 years, 3 months ago (2015-08-27 18:25:50 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/93735)
5 years, 3 months ago (2015-08-27 18:36:56 UTC) #8
paulmeyer
+kenrb@ for extension_messages.h +kalman@ for the rest
5 years, 3 months ago (2015-08-27 19:19:21 UTC) #10
not at google - send to devlin
https://codereview.chromium.org/1312653003/diff/20001/chrome/renderer/extensions/resource_request_policy.cc File chrome/renderer/extensions/resource_request_policy.cc (right): https://codereview.chromium.org/1312653003/diff/20001/chrome/renderer/extensions/resource_request_policy.cc#newcode66 chrome/renderer/extensions/resource_request_policy.cc:66: extension->GetManifestData(manifest_keys::kWebviewAccessibleResources)); Usually there would be a WebviewInfo::Get(extension) method. Could ...
5 years, 3 months ago (2015-08-27 20:01:25 UTC) #11
paulmeyer
PTAL https://codereview.chromium.org/1312653003/diff/20001/chrome/renderer/extensions/resource_request_policy.cc File chrome/renderer/extensions/resource_request_policy.cc (right): https://codereview.chromium.org/1312653003/diff/20001/chrome/renderer/extensions/resource_request_policy.cc#newcode66 chrome/renderer/extensions/resource_request_policy.cc:66: extension->GetManifestData(manifest_keys::kWebviewAccessibleResources)); On 2015/08/27 20:01:25, kalman wrote: > Usually ...
5 years, 3 months ago (2015-08-31 15:32:55 UTC) #14
not at google - send to devlin
https://codereview.chromium.org/1312653003/diff/80001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/1312653003/diff/80001/chrome/browser/extensions/extension_service.cc#newcode1050 chrome/browser/extensions/extension_service.cc:1050: extensions::WebViewGuest::GetPartitionID(host))); You should only need to tell host renderers ...
5 years, 3 months ago (2015-08-31 18:31:44 UTC) #15
paulmeyer
PTAL https://codereview.chromium.org/1312653003/diff/80001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/1312653003/diff/80001/chrome/browser/extensions/extension_service.cc#newcode1050 chrome/browser/extensions/extension_service.cc:1050: extensions::WebViewGuest::GetPartitionID(host))); On 2015/08/31 18:31:44, kalman wrote: > You ...
5 years, 3 months ago (2015-08-31 21:40:08 UTC) #17
not at google - send to devlin
https://codereview.chromium.org/1312653003/diff/80001/extensions/browser/guest_view/web_view/web_view_guest.cc File extensions/browser/guest_view/web_view/web_view_guest.cc (right): https://codereview.chromium.org/1312653003/diff/80001/extensions/browser/guest_view/web_view/web_view_guest.cc#newcode275 extensions/browser/guest_view/web_view/web_view_guest.cc:275: renderer_state->GetPartitionID(process_id, &partition_id); On 2015/08/31 21:40:08, Paul Meyer wrote: > ...
5 years, 3 months ago (2015-08-31 21:52:51 UTC) #18
paulmeyer
kalman@: PTAL. https://codereview.chromium.org/1312653003/diff/80001/extensions/browser/guest_view/web_view/web_view_guest.cc File extensions/browser/guest_view/web_view/web_view_guest.cc (right): https://codereview.chromium.org/1312653003/diff/80001/extensions/browser/guest_view/web_view/web_view_guest.cc#newcode275 extensions/browser/guest_view/web_view/web_view_guest.cc:275: renderer_state->GetPartitionID(process_id, &partition_id); On 2015/08/31 21:52:51, kalman wrote: ...
5 years, 3 months ago (2015-09-02 13:43:57 UTC) #19
kenrb
ipc lgtm
5 years, 3 months ago (2015-09-02 14:43:02 UTC) #20
not at google - send to devlin
Just nits left for the code, so that lg. But this is missing a test. ...
5 years, 3 months ago (2015-09-03 20:17:54 UTC) #21
paulmeyer
kalman@: PTAL https://codereview.chromium.org/1312653003/diff/140001/chrome/renderer/chrome_content_renderer_client.cc File chrome/renderer/chrome_content_renderer_client.cc (right): https://codereview.chromium.org/1312653003/diff/140001/chrome/renderer/chrome_content_renderer_client.cc#newcode1293 chrome/renderer/chrome_content_renderer_client.cc:1293: !(resource_request_policy_ && On 2015/09/03 20:17:53, kalman wrote: ...
5 years, 3 months ago (2015-09-08 18:51:36 UTC) #23
not at google - send to devlin
lgtm https://codereview.chromium.org/1312653003/diff/140001/chrome/renderer/chrome_content_renderer_client.cc File chrome/renderer/chrome_content_renderer_client.cc (right): https://codereview.chromium.org/1312653003/diff/140001/chrome/renderer/chrome_content_renderer_client.cc#newcode1293 chrome/renderer/chrome_content_renderer_client.cc:1293: !(resource_request_policy_ && On 2015/09/08 18:51:36, Paul Meyer wrote: ...
5 years, 3 months ago (2015-09-08 20:10:24 UTC) #24
paulmeyer
+sky@ for OWNER review of plugin_info_message_filter.cc and chrome_content_renderer_client.h/cc
5 years, 3 months ago (2015-09-08 22:21:48 UTC) #26
sky
LGTM
5 years, 3 months ago (2015-09-08 23:46:52 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1312653003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1312653003/200001
5 years, 3 months ago (2015-09-09 00:00:31 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/79335) linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, ...
5 years, 3 months ago (2015-09-09 00:17:52 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1312653003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1312653003/220001
5 years, 3 months ago (2015-09-09 14:01:04 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:220001)
5 years, 3 months ago (2015-09-09 15:30:06 UTC) #36
commit-bot: I haz the power
5 years, 3 months ago (2015-09-09 15:30:46 UTC) #37
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ad727fc6c70d04cdd0a9a7d14c4aa68b4c0e8e72
Cr-Commit-Position: refs/heads/master@{#347936}

Powered by Google App Engine
This is Rietveld 408576698