Attention is currently required from: Richard Coles.
1 comment:
Patchset:
Hi Richard,
Permissions team is verifying if `allow_universal_access_from_file_urls` is enabled before fetching an origin. But I believe there is no reason to check it for all platforms, hence I've added the verification only for Android.
Please check if it make sense?
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Illia Klimov.
Patch set 4:Code-Review +1
1 comment:
Patchset:
Hi Richard, […]
Yes - only Android WebView is allowed to enable this, and I believe there are already other places that check this which are also only enabled for OS_ANDROID.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
1 comment:
Patchset:
Hi Andy,
It makes sense to check `allow_universal_access_from_file_urls` flag only if it is Android, hence I'm adding it under IS_ANDROID. PTAL.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Illia Klimov.
1 comment:
File content/browser/permissions/permission_util.cc:
Patch Set #4, Line 25: #if BUILDFLAG(IS_ANDROID)
Should the code at https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/browser/web_test_permission_manager.cc;l=28?q=%60allow_universal_access_from_file_urls%60 also be updated?
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Arthur Sonzogni.
2 comments:
Patchset:
Hi Andy,
thank you for the comment, PTAL.
@arthursonzogni:
content/web_test/browser/web_test_permission_manager.cc
File content/browser/permissions/permission_util.cc:
Patch Set #4, Line 25: #if BUILDFLAG(IS_ANDROID)
Should the code at https://source.chromium. […]
Thank you, updated!
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
Patch set 6:Code-Review +1
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
1 comment:
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
This is duplicated from two other location. Should you try to deduplicate? Or at least add a comment explaining this function must be kept in sync, similar to the comment in the previous file?
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Illia Klimov.
1 comment:
File chrome/browser/permissions/permissions_security_model_interactive_uitest.cc:
Patch Set #6, Line 913: /*expect_granted*/ false
nit: The clang-format recognized format for this is:
```
/*expect_granted=*/false
```
clang-format will remove spaces in between the comment and the value. We might also have some kind of checks the comment is matching the argument it is referring too.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni.
3 comments:
Patchset:
Hi Arthur, thanks for the comments, PTAL
File chrome/browser/permissions/permissions_security_model_interactive_uitest.cc:
Patch Set #6, Line 913: /*expect_granted*/ false
nit: The clang-format recognized format for this is: […]
Thank you!
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
This is duplicated from two other location. […]
I would really like to deduplicate and I've tried it in the previous patchset [1]. But due to dependencies issue, using //content/browser/* inside //content/web_test/* I wasn't able to do it.
Maybe you know how can I add such dependency?
[1] https://chromium-review.googlesource.com/c/chromium/src/+/3720955/5
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
3 comments:
Patchset:
+Dana for the question about `web_test_browser` depending on `content/browser:browser`
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
I would really like to deduplicate and I've tried it in the previous patchset [1]. […]
So, you would like to make the target `web_test_browser` to depend on `content/browser`
I see the file:
`content/web_test/browser/web_test_permission_manager.cc`
is for the target:
`web_test_browser`
Then, it seems Chrome is doing something very special about this target depending on content/browser depending on
In the `content/web_test/BUILD.gn`, I see
```
# This is to support our dependency on //content/browser.
# See comment at the top of //content/BUILD.gn for why this is disabled in
# component builds.
if (is_component_build) {
check_includes = false
}
```
and the
```
deps = [
"//content/browser:for_content_tests", # For non-component builds.
"//content/public/browser", # For component builds.
]
```
I am not sure to understand everything. @danakj probably knows. I guess you can't because this is not defined from content/public/browser and not visible for the web_test_browser target.
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #7, Line 24: GetLastCommittedOriginAsURL
At least, could you add:
```
// Due to dependency issues, this method is duplicated in
// content/browser/permissions/permission_util.cc.
```
similar to what is done in:
components/permissions/permission_util.cc
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Arthur Sonzogni, Illia Klimov.
1 comment:
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
So, you would like to make the target `web_test_browser` to depend on `content/browser` […]
Web test code can depend on content/browser/ internals, since it's not production.
"//content/browser:for_content_tests" does exactly that.
The error in PS5 is a linking error because the permission util method is not exported, so it's not available for linking in the component build. It should be exported with content/common/content_export.h
That's why it is failing on _debug_ bots, they are component builds.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
1 comment:
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
Web test code can depend on content/browser/ internals, since it's not production. […]
Thanks Dana!
So let's do this and remove this duplicated function.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, danakj.
3 comments:
Patchset:
Hi Dana,
thank you for the suggestion, exporting API fixed the linking issue. Arthur is OOO, could you please stamp `content/web_test/browser/web_test_permission_manager.cc`?
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #6, Line 24: GURL GetLastCommittedOriginAsURL(content::RenderFrameHost* render_frame_host) {
Thanks Dana! […]
Thank you!
File content/web_test/browser/web_test_permission_manager.cc:
Patch Set #7, Line 24: GetLastCommittedOriginAsURL
At least, could you add: […]
Removed duplication.
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
Patch set 9:Code-Review +1
1 comment:
Patchset:
LGTM
To view, visit change 3720955. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Arthur Sonzogni, Illia Klimov.
Patch set 9:Commit-Queue +2
Chromium LUCI CQ submitted this change.
Make `allow_universal_access_from_file_urls` verification Android only.
An origin for permissions request and verification is calculated as RFH::GetLastCommittedOrigin(). On Android it is possible to change visible URL if `allow_universal_access_from_file_urls` flag is enabled. To meet users' expectation, we use RFH::GetLastCommittedURL().
This CL restricts `allow_universal_access_from_file_urls` flag verification only for Android.
Bug: 1327384
Change-Id: Ibd59f59e2d12500f717af3a32fc1c089bd01094a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3720955
Commit-Queue: Illia Klimov <el...@google.com>
Reviewed-by: Richard Coles <to...@chromium.org>
Reviewed-by: Andy Paicu <andy...@chromium.org>
Reviewed-by: danakj <dan...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025707}
---
M chrome/browser/permissions/permissions_security_model_interactive_uitest.cc
M components/permissions/permission_util.cc
M content/browser/permissions/permission_util.cc
M content/browser/permissions/permission_util.h
M content/web_test/browser/web_test_permission_manager.cc
5 files changed, 63 insertions(+), 48 deletions(-)