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

Issue 2815003005: Integrate WebUSB with Feature Policy (Closed)

Created:
3 years, 8 months ago by Reilly Grant (use Gerrit)
Modified:
3 years, 5 months ago
CC:
Aaron Boodman, abarth-chromium, arv+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-bindings_chromium.org, blink-reviews-w3ctests_chromium.org, chasej+watch_chromium.org, chromium-reviews, creis+watch_chromium.org, darin (slow to review), darin-cc_chromium.org, dglazkov+blink, fuzzing_chromium.org, haraken, iclelland+watch_chromuim.org, jam, nasko+codewatch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Integrate WebUSB with Feature Policy This patch uses the new Feature Policy framework to control access to WebUSB from embedded frames. When Feature Policy is available WebUSB's default policy ["self"] is enforced. When it isn't available WebUSB is simply disallowed in embedded frames. A follow-up patch will remove the parser for the "allowed origins" descriptor as they are no longer used and have been removed from the specification. BUG=711443 Review-Url: https://codereview.chromium.org/2815003005 Cr-Commit-Position: refs/heads/master@{#471487} Committed: https://chromium.googlesource.com/chromium/src/+/aee98b5c7aebe3c263f2150357d36901efbf0d53

Patch Set 1 #

Patch Set 2 : rebased #

Patch Set 3 : Ready for review #

Total comments: 19

Patch Set 4 : Addressed iclelland@'s comments #

Patch Set 5 : Add Feature Policy tests that set headers #

Total comments: 4

Patch Set 6 : Fixed usb-allowed-by-feature-policy.https.sub.html #

Total comments: 2

Patch Set 7 : Move the WebFeaturePolicyFeature enum into its own header #

Patch Set 8 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+278 lines, -336 lines) Patch
M chrome/browser/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/usb/usb_browsertest.cc View 1 2 3 4 5 6 7 4 chunks +4 lines, -53 lines 0 comments Download
M chrome/browser/usb/usb_chooser_controller.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/usb/usb_chooser_controller.cc View 1 2 4 chunks +1 line, -11 lines 0 comments Download
M chrome/browser/usb/usb_chooser_controller_unittest.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/usb/usb_tab_helper.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/usb/usb_tab_helper.cc View 1 2 3 4 5 6 5 chunks +31 lines, -1 line 0 comments Download
M chrome/browser/usb/web_usb_permission_provider.h View 2 chunks +0 lines, -8 lines 0 comments Download
M chrome/browser/usb/web_usb_permission_provider.cc View 3 chunks +3 lines, -63 lines 0 comments Download
M content/common/feature_policy/feature_policy.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M device/usb/mojo/device_impl.cc View 1 2 3 4 5 5 chunks +24 lines, -52 lines 0 comments Download
M device/usb/mojo/device_impl_unittest.cc View 1 2 9 chunks +2 lines, -7 lines 0 comments Download
M device/usb/mojo/mock_permission_provider.h View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M device/usb/mojo/mock_permission_provider.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M device/usb/mojo/permission_provider.h View 2 chunks +0 lines, -9 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/resources/check-availability.html View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/resources/featurepolicytest.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy-attribute.https.sub.html View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html.headers View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-feature-policy.https.sub.html View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html.headers View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webusb/USB.cpp View 1 2 5 chunks +81 lines, -40 lines 0 comments Download
M third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebFeaturePolicy.h View 1 2 3 4 5 6 1 chunk +1 line, -45 lines 0 comments Download
A + third_party/WebKit/public/platform/WebFeaturePolicyFeature.h View 1 2 3 4 5 6 2 chunks +7 lines, -32 lines 0 comments Download

Messages

Total messages: 61 (29 generated)
Reilly Grant (use Gerrit)
rebased
3 years, 8 months ago (2017-04-14 21:46:04 UTC) #3
Reilly Grant (use Gerrit)
Ready for review
3 years, 7 months ago (2017-05-01 23:06:24 UTC) #6
Reilly Grant (use Gerrit)
iclelland@, please do a general review. rbyers@, please do an API_OWNERS review.
3 years, 7 months ago (2017-05-01 23:10:33 UTC) #8
Rick Byers
On 2017/05/01 23:10:33, Reilly Grant wrote: > iclelland@, please do a general review. > rbyers@, ...
3 years, 7 months ago (2017-05-02 13:26:56 UTC) #13
Reilly Grant (use Gerrit)
On 2017/05/02 13:26:56, Rick Byers wrote: > On 2017/05/01 23:10:33, Reilly Grant wrote: > > ...
3 years, 7 months ago (2017-05-02 14:33:25 UTC) #14
iclelland.google
FP integration looks pretty good -- I can see some opportunities to change the API ...
3 years, 7 months ago (2017-05-02 14:42:52 UTC) #16
iclelland.google
+lunalu to take a look at the layout tests
3 years, 7 months ago (2017-05-02 14:43:43 UTC) #18
Reilly Grant (use Gerrit)
Addressed iclelland@'s comments
3 years, 7 months ago (2017-05-02 19:28:26 UTC) #19
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2815003005/diff/40001/chrome/browser/usb/usb_tab_helper.cc File chrome/browser/usb/usb_tab_helper.cc (right): https://codereview.chromium.org/2815003005/diff/40001/chrome/browser/usb/usb_tab_helper.cc#newcode66 chrome/browser/usb/usb_tab_helper.cc:66: if (base::FeatureList::IsEnabled(features::kFeaturePolicy)) { On 2017/05/02 14:42:52, iclelland.google wrote: > ...
3 years, 7 months ago (2017-05-02 19:29:06 UTC) #22
lunalu1
Hi Reilly, Thank you for writing this CL. Sorry for my delayed reply. I left ...
3 years, 7 months ago (2017-05-03 15:01:22 UTC) #25
lunalu1
Hi Reilly, Thank you for writing this CL. Sorry for my delayed reply. I left ...
3 years, 7 months ago (2017-05-03 15:01:26 UTC) #26
lunalu1
Hopefully this CL can give you a better idea of what needs to be tested ...
3 years, 7 months ago (2017-05-03 21:40:10 UTC) #27
Reilly Grant (use Gerrit)
I've fleshed out the web platform tests some more however usb-allowed-by-feature-policy.https.sub.html is not passing. Did ...
3 years, 7 months ago (2017-05-04 01:16:50 UTC) #29
lunalu1
On 2017/05/04 01:16:50, Reilly Grant wrote: > I've fleshed out the web platform tests some ...
3 years, 7 months ago (2017-05-04 14:36:58 UTC) #30
iclelland
Feature policy integration lgtm https://codereview.chromium.org/2815003005/diff/40001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2815003005/diff/40001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode137 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:137: default_feature_name_map.Set("usb", WebFeaturePolicyFeature::kUsb); On 2017/05/02 19:29:05, ...
3 years, 7 months ago (2017-05-04 15:24:09 UTC) #31
Reilly Grant (use Gerrit)
Fixed usb-allowed-by-feature-policy.https.sub.html
3 years, 7 months ago (2017-05-04 20:34:35 UTC) #32
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2815003005/diff/80001/device/usb/mojo/device_impl.cc File device/usb/mojo/device_impl.cc (right): https://codereview.chromium.org/2815003005/diff/80001/device/usb/mojo/device_impl.cc#newcode168 device/usb/mojo/device_impl.cc:168: return interface; On 2017/05/04 15:24:08, iclelland wrote: > Returning ...
3 years, 7 months ago (2017-05-04 20:34:46 UTC) #33
Reilly Grant (use Gerrit)
jochen@, please review these files: chrome/browser/DEPS third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp third_party/WebKit/public/platform/WebFeaturePolicy.h
3 years, 7 months ago (2017-05-04 20:40:05 UTC) #35
Rick Byers
WebKit LGTM (up to you if you still want to ask jochen@ for a review ...
3 years, 7 months ago (2017-05-04 20:52:48 UTC) #37
jbroman
On 2017/05/02 at 14:33:25, reillyg wrote: > On 2017/05/02 13:26:56, Rick Byers wrote: > > ...
3 years, 7 months ago (2017-05-04 21:18:02 UTC) #38
Reilly Grant (use Gerrit)
On 2017/05/04 20:52:48, Rick Byers wrote: > WebKit LGTM > (up to you if you ...
3 years, 7 months ago (2017-05-04 21:28:07 UTC) #39
Rick Byers
On 2017/05/04 21:28:07, Reilly Grant wrote: > On 2017/05/04 20:52:48, Rick Byers wrote: > > ...
3 years, 7 months ago (2017-05-04 21:40:22 UTC) #40
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2815003005/diff/100001/chrome/browser/DEPS File chrome/browser/DEPS (right): https://codereview.chromium.org/2815003005/diff/100001/chrome/browser/DEPS#newcode109 chrome/browser/DEPS:109: "+third_party/WebKit/public/platform/WebFeaturePolicy.h", the browser process must only depend on pure ...
3 years, 7 months ago (2017-05-05 14:28:07 UTC) #41
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2815003005/diff/100001/chrome/browser/DEPS File chrome/browser/DEPS (right): https://codereview.chromium.org/2815003005/diff/100001/chrome/browser/DEPS#newcode109 chrome/browser/DEPS:109: "+third_party/WebKit/public/platform/WebFeaturePolicy.h", On 2017/05/05 14:28:06, jochen wrote: > the browser ...
3 years, 7 months ago (2017-05-05 22:10:15 UTC) #42
jochen (gone - plz use gerrit)
lgtm
3 years, 7 months ago (2017-05-08 06:17:09 UTC) #43
lunalu1
wpt lgtm
3 years, 7 months ago (2017-05-08 15:12:12 UTC) #44
Reilly Grant (use Gerrit)
Rebased
3 years, 7 months ago (2017-05-12 18:28:57 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2815003005/140001
3 years, 7 months ago (2017-05-12 18:30:35 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/425469)
3 years, 7 months ago (2017-05-12 20:04:15 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2815003005/140001
3 years, 7 months ago (2017-05-12 20:38:50 UTC) #56
commit-bot: I haz the power
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/aee98b5c7aebe3c263f2150357d36901efbf0d53
3 years, 7 months ago (2017-05-12 23:31:32 UTC) #59
loonybear
3 years, 5 months ago (2017-07-12 19:06:34 UTC) #61
Message was sent while issue was closed.
Hi Reilly, 

A while ago, we added this method
IsSupportedInFeaturePolicy(WebFeaturePolicyFeature);
in third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h
to check if feature policy is enabled and |feature| is supported in feature
policy.

Currently the other features in feature policy are using it. Examples
(third_party/WebKit/Source/core/dom/Fullscreen.cpp,
third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp,
third_party/WebKit/Source/modules/payments/PaymentRequest.cpp)

Not so sure if this would apply to web usb. This is just FYI.

Thanks,
Luna

Powered by Google App Engine
This is Rietveld 408576698