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

Issue 1099453005: Switch web API/permission code to use IsOriginSecure() instead of SchemeIsSecure(). (Closed)

Created:
5 years, 8 months ago by lgarron
Modified:
4 years ago
CC:
browser-components-watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, estade+watch_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+watch, kinuko+serviceworker, markusheintz_, mcasas+watch_chromium.org, michaeln, nhiroki, posciak+watch_chromium.org, rouslan+autofillwatch_chromium.org, serviceworker-reviews, tzik, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch web API/permission code to use IsOriginSecure() and SchemeIsCryptographic() instead of SchemeIsSecure(). We recently introduced SchemeIsCryptographic() and IsOriginSecure(), which are meant to replace SchemeIsSecure(). IsOriginSecure() roughly means "do we trust this content not to be tampered with before it reaches the user?" [1] This is a higher-level definition that corresponds to the new "privileged contexts" spec. [2] SchemeIsCryptographic() [3] is close to the old definition of SchemeIsSecure(), and literally just checks if the scheme is a cryptographic scheme (HTTPS or WSS as of right now). The difference is that SchemeIsCryptographic() will not consider filesystem URLs secure. IsOriginSecure() should be correct for most Fizz code. [1] https://code.google.com/p/chromium/codesearch#chromium/src/content/public/common/origin_util.h&sq=package:chromium&type=cs&l=19&rcl=143099866 [2] https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features and https://w3c.github.io/webappsec/specs/powerfulfeatures/ [3] https://code.google.com/p/chromium/codesearch#chromium/src/url/gurl.h&sq=package:chromium&type=cs&l=250&rcl=1430998666 BUG=362214

Patch Set 1 : #

Patch Set 2 : Remove an ad-hoc definition of IsSchemeSecure() from a header file. #

Total comments: 2

Patch Set 3 : Address nhiroki's comment. #

Total comments: 11

Patch Set 4 : Address jww's comments. #

Total comments: 3

Patch Set 5 : Rebase onto the moved version of IsOriginSecure (https://codereview.chromium.org/1101033003/). #

Total comments: 12

Patch Set 6 : Change WalletServiceUrl::IsSignInContinueUrl to use SchemeIsCryptographic. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -28 lines) Patch
M chrome/browser/banners/app_banner_manager.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/content_settings/permission_context_uma_util.cc View 1 2 3 4 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc View 1 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/media/media_capture_devices_dispatcher.cc View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.cc View 1 2 3 4 5 chunks +4 lines, -8 lines 0 comments Download
M chrome/browser/media/media_stream_infobar_delegate.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/content_settings/content_setting_bubble_model.cc View 1 2 3 4 2 chunks +2 lines, -1 line 1 comment Download
M chrome/browser/ui/website_settings/permission_menu_model.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M components/autofill/content/browser/wallet/wallet_service_url_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M components/content_settings/core/browser/host_content_settings_map.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_update_job.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 44 (13 generated)
lgarron
I tried to separate out all the permission/Fizz code that should pretty much be aligned ...
5 years, 8 months ago (2015-04-22 23:06:07 UTC) #5
nhiroki
Drive by comment: https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode62 content/browser/service_worker/service_worker_dispatcher_host.cc:62: IsOriginSecure(script_url); IsOriginSecure() is not sufficient here ...
5 years, 8 months ago (2015-04-23 01:29:58 UTC) #9
kinuko
On 2015/04/23 01:29:58, nhiroki wrote: > Drive by comment: > > https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc > File content/browser/service_worker/service_worker_dispatcher_host.cc ...
5 years, 8 months ago (2015-04-23 01:42:31 UTC) #10
lgarron
On 2015/04/23 at 01:42:31, kinuko wrote: > On 2015/04/23 01:29:58, nhiroki wrote: > > Drive ...
5 years, 8 months ago (2015-04-23 01:50:35 UTC) #11
lgarron
https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode62 content/browser/service_worker/service_worker_dispatcher_host.cc:62: IsOriginSecure(script_url); On 2015/04/23 01:29:58, nhiroki wrote: > IsOriginSecure() is ...
5 years, 8 months ago (2015-04-23 02:06:04 UTC) #12
lgarron
https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/1099453005/diff/120001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode62 content/browser/service_worker/service_worker_dispatcher_host.cc:62: IsOriginSecure(script_url); On 2015/04/23 01:29:58, nhiroki wrote: > IsOriginSecure() is ...
5 years, 8 months ago (2015-04-23 02:06:04 UTC) #13
jww
lgarron, you're on the right track, but as it stands, this is not lgtm because ...
5 years, 8 months ago (2015-04-23 18:24:02 UTC) #14
palmer
Don't worry; kinuko has a nicely layered patch coming soon: https://codereview.chromium.org/1101033003/ This CL will be ...
5 years, 8 months ago (2015-04-23 18:39:15 UTC) #15
jww
On 2015/04/23 18:39:15, palmer wrote: > Don't worry; kinuko has a nicely layered patch coming ...
5 years, 8 months ago (2015-04-23 18:46:48 UTC) #16
lgarron
https://codereview.chromium.org/1099453005/diff/140001/chrome/browser/banners/app_banner_manager.cc File chrome/browser/banners/app_banner_manager.cc (right): https://codereview.chromium.org/1099453005/diff/140001/chrome/browser/banners/app_banner_manager.cc#newcode51 chrome/browser/banners/app_banner_manager.cc:51: // A secure scheme is required to show banners, ...
5 years, 8 months ago (2015-04-23 23:05:51 UTC) #17
Evan Stade
https://codereview.chromium.org/1099453005/diff/140001/components/autofill/content/browser/DEPS File components/autofill/content/browser/DEPS (right): https://codereview.chromium.org/1099453005/diff/140001/components/autofill/content/browser/DEPS#newcode2 components/autofill/content/browser/DEPS:2: "+chrome/common/origin_util.h", On 2015/04/23 23:05:51, lgarron wrote: > On 2015/04/23 ...
5 years, 8 months ago (2015-04-24 02:26:03 UTC) #19
lgarron
ddorwin: Could you check chrome/browser/media/* (4 files) and see if IsOriginSecure is the right check? ...
5 years, 8 months ago (2015-04-27 23:21:53 UTC) #22
ddorwin
On 2015/04/27 23:21:53, lgarron wrote: > ddorwin: Could you check chrome/browser/media/* (4 files) and see ...
5 years, 8 months ago (2015-04-27 23:41:05 UTC) #24
tommi (sloooow) - chröme
https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/media/media_capture_devices_dispatcher.cc File chrome/browser/media/media_capture_devices_dispatcher.cc (right): https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/media/media_capture_devices_dispatcher.cc#newcode599 chrome/browser/media/media_capture_devices_dispatcher.cc:599: IsOriginSecure(request.security_origin) || Does IsOriginSecure return true for extensions?
5 years, 7 months ago (2015-04-28 07:25:56 UTC) #25
kinuko
On 2015/04/28 07:25:56, tommi wrote: > https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/media/media_capture_devices_dispatcher.cc > File chrome/browser/media/media_capture_devices_dispatcher.cc (right): > > https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/media/media_capture_devices_dispatcher.cc#newcode599 > ...
5 years, 7 months ago (2015-04-28 07:39:04 UTC) #26
lgarron
On 2015/04/28 at 07:39:04, kinuko wrote: > On 2015/04/28 07:25:56, tommi wrote: > > https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/media/media_capture_devices_dispatcher.cc ...
5 years, 7 months ago (2015-04-30 18:53:57 UTC) #27
palmer
https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/banners/app_banner_manager.cc File chrome/browser/banners/app_banner_manager.cc (right): https://codereview.chromium.org/1099453005/diff/180001/chrome/browser/banners/app_banner_manager.cc#newcode51 chrome/browser/banners/app_banner_manager.cc:51: // A secure origin is required to show banners, ...
5 years, 7 months ago (2015-04-30 19:05:11 UTC) #28
tommi (sloooow) - chröme
On 2015/04/30 at 18:53:57, lgarron wrote: > On 2015/04/28 at 07:39:04, kinuko wrote: > > ...
5 years, 7 months ago (2015-05-04 10:45:56 UTC) #29
lgarron
On 2015/05/04 at 10:45:56, tommi wrote: > On 2015/04/30 at 18:53:57, lgarron wrote: > > ...
5 years, 7 months ago (2015-05-05 22:56:26 UTC) #30
lgarron
Adding several new reviewers. Would you mind checking if IsOriginSecure() is correct for your files? ...
5 years, 7 months ago (2015-05-07 19:08:12 UTC) #31
lgarron
Adding several new reviewers. Would you mind checking if IsOriginSecure() is correct for your files? ...
5 years, 7 months ago (2015-05-07 19:09:23 UTC) #33
Dan Beam
https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc File components/autofill/content/browser/wallet/wallet_service_url_unittest.cc (left): https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc#oldcode118 components/autofill/content/browser/wallet/wallet_service_url_unittest.cc:118: EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); the intent of this is to ensure the ...
5 years, 7 months ago (2015-05-07 20:50:53 UTC) #34
lgarron
https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc File components/autofill/content/browser/wallet/wallet_service_url_unittest.cc (left): https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc#oldcode118 components/autofill/content/browser/wallet/wallet_service_url_unittest.cc:118: EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); On 2015/05/07 20:50:53, Dan Beam wrote: > the ...
5 years, 7 months ago (2015-05-07 20:55:33 UTC) #35
palmer
https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc File components/autofill/content/browser/wallet/wallet_service_url_unittest.cc (left): https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc#oldcode118 components/autofill/content/browser/wallet/wallet_service_url_unittest.cc:118: EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); On 2015/05/07 20:50:53, Dan Beam wrote: > the ...
5 years, 7 months ago (2015-05-07 20:57:10 UTC) #36
Dan Beam
https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc File components/autofill/content/browser/wallet/wallet_service_url_unittest.cc (left): https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc#oldcode118 components/autofill/content/browser/wallet/wallet_service_url_unittest.cc:118: EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); On 2015/05/07 20:57:10, palmer wrote: > On 2015/05/07 ...
5 years, 7 months ago (2015-05-07 20:58:29 UTC) #37
lgarron
https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc File components/autofill/content/browser/wallet/wallet_service_url_unittest.cc (left): https://codereview.chromium.org/1099453005/diff/180001/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc#oldcode118 components/autofill/content/browser/wallet/wallet_service_url_unittest.cc:118: EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); On 2015/05/07 20:58:29, Dan Beam wrote: > On ...
5 years, 7 months ago (2015-05-07 21:08:32 UTC) #38
lgarron
Adding felt@ for chrome/browser/ui/website_settings/permission_menu_model.cc
5 years, 7 months ago (2015-05-08 03:02:07 UTC) #40
lgarron
https://codereview.chromium.org/1099453005/diff/160001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1099453005/diff/160001/components/content_settings/core/browser/host_content_settings_map.cc#newcode658 components/content_settings/core/browser/host_content_settings_map.cc:658: IsOriginSecure(primary_url)) { bauerb@: `git cl upload` complains: You added ...
5 years, 7 months ago (2015-05-08 03:05:49 UTC) #41
Bernhard Bauer
+Miguel for the UMA question. https://codereview.chromium.org/1099453005/diff/160001/chrome/browser/content_settings/permission_context_uma_util.cc File chrome/browser/content_settings/permission_context_uma_util.cc (right): https://codereview.chromium.org/1099453005/diff/160001/chrome/browser/content_settings/permission_context_uma_util.cc#newcode84 chrome/browser/content_settings/permission_context_uma_util.cc:84: bool secure_origin = IsOriginSecure(requesting_origin); ...
5 years, 7 months ago (2015-05-08 09:06:31 UTC) #42
felt
Should this be broken up into several CLs?
5 years, 7 months ago (2015-05-08 18:11:48 UTC) #43
lgarron
5 years, 7 months ago (2015-05-08 21:59:51 UTC) #44
On 2015/05/08 18:11:48, felt wrote:
> Should this be broken up into several CLs?

Probably. This level of grouping made sense to me at the time, but the number of
owners turned out to be wieldy.
I'll start by splitting out the media code.

Powered by Google App Engine
This is Rietveld 408576698