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

Issue 1049533002: Add IsOriginSecure and GURL::SchemeUsesTLS. (Closed)

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

Description

Add IsOriginSecure and GURL::SchemeUsesTLS. Standard functions for people to check if content from an origin can be considered to have been transferred to the browser securely, as defined in https://www.w3.org/TR/powerful-features/#is-origin-trustworthy. BUG=362214, 470142 Committed: https://crrev.com/6c3473c3489dae0bfd2133c22e6b5cd9fb4f5fef Cr-Commit-Position: refs/heads/master@{#325495}

Patch Set 1 #

Patch Set 2 : More precise documentation. #

Patch Set 3 : Be even more precise in comments. #

Total comments: 2

Patch Set 4 : Move it to content::, so we can call into net:: and blink::. #

Total comments: 3

Patch Set 5 : One does not simply check schemes and hosts for membership in tiny sets... #

Total comments: 4

Patch Set 6 : More thoroughly document all 3 layers of the functionality. #

Patch Set 7 : Update the commit message to reflect the changes. #

Total comments: 4

Patch Set 8 : Fold the content:: version into the chrome/ version. Just 1 now. More tests, including filesystem:. #

Total comments: 10

Patch Set 9 : Make the comments reflect reality. #

Total comments: 2

Patch Set 10 : Fix the comments for real. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -5 lines) Patch
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
A chrome/common/origin_util.h View 1 2 3 4 5 6 7 8 1 chunk +17 lines, -0 lines 0 comments Download
A chrome/common/origin_util.cc View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/common/origin_util_unittest.cc View 1 2 3 4 5 6 7 1 chunk +45 lines, -0 lines 0 comments Download
M url/gurl.h View 1 2 3 4 5 6 7 8 9 3 chunks +24 lines, -4 lines 1 comment Download

Messages

Total messages: 55 (11 generated)
palmer
This is 1 of a set of hopefully small CLs to polish off crbug.com/362214.
5 years, 8 months ago (2015-03-30 23:33:02 UTC) #2
palmer
Adding abarth as the other url/ OWNER in case brettw is too busy. But, abarth ...
5 years, 8 months ago (2015-03-31 19:29:25 UTC) #4
felt
https://codereview.chromium.org/1049533002/diff/40001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/40001/url/gurl.h#newcode262 url/gurl.h:262: bool HostIsLocal() const; this seems redundant with net::IsLocalhost (also ...
5 years, 8 months ago (2015-04-01 18:03:18 UTC) #6
palmer
> this seems redundant with net::IsLocalhost (also what about net::IsLocalhostTLD) It is — but I ...
5 years, 8 months ago (2015-04-01 19:51:49 UTC) #7
palmer
https://codereview.chromium.org/1049533002/diff/40001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/40001/url/gurl.h#newcode262 url/gurl.h:262: bool HostIsLocal() const; Yes, I have 2 reasons to ...
5 years, 8 months ago (2015-04-03 22:59:29 UTC) #8
palmer
(Yes, I realize the tests should not be in gurl_unittest.cc. I'll move them into the ...
5 years, 8 months ago (2015-04-03 23:26:06 UTC) #10
tkent
https://codereview.chromium.org/1049533002/diff/60001/content/common/url_schemes.cc File content/common/url_schemes.cc (right): https://codereview.chromium.org/1049533002/diff/60001/content/common/url_schemes.cc#newcode91 content/common/url_schemes.cc:91: if (blink::WebSecurityPolicy::shouldTreatURLSchemeAsSecure(scheme)) Does this code run in the browser ...
5 years, 8 months ago (2015-04-05 22:31:38 UTC) #11
palmer
> (blink::WebSecurityPolicy::shouldTreatURLSchemeAsSecure(scheme)) > Does this code run in the browser process? If so, we should ...
5 years, 8 months ago (2015-04-06 18:03:57 UTC) #12
brettw
lgtm https://codereview.chromium.org/1049533002/diff/60001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/60001/url/gurl.h#newcode229 url/gurl.h:229: SchemeIs(url::kWssScheme) || (SchemeIsFileSystem() && inner_url() && I found ...
5 years, 8 months ago (2015-04-06 20:19:05 UTC) #13
davidben
https://codereview.chromium.org/1049533002/diff/60001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/60001/url/gurl.h#newcode228 url/gurl.h:228: return SchemeIs(url::kFileScheme) || SchemeIs(url::kHttpsScheme) || I'm worried changing this ...
5 years, 8 months ago (2015-04-06 21:02:55 UTC) #15
tkent
On 2015/04/06 18:03:57, palmer wrote: > > (blink::WebSecurityPolicy::shouldTreatURLSchemeAsSecure(scheme)) > > Does this code run in ...
5 years, 8 months ago (2015-04-06 23:24:12 UTC) #16
palmer
OK, given the handy clues from davidben and tkent — thank you! —, I propose ...
5 years, 8 months ago (2015-04-07 19:25:35 UTC) #17
davidben
On 2015/04/07 19:25:35, palmer wrote: > OK, given the handy clues from davidben and tkent ...
5 years, 8 months ago (2015-04-07 19:33:56 UTC) #18
palmer
Patchset 5 does this: > > 1. Make a GURL::SchemeUsesTLS that behaves as davidben suggests. ...
5 years, 8 months ago (2015-04-08 00:00:17 UTC) #19
felt
On 2015/04/08 00:00:17, palmer wrote: > Patchset 5 does this: > > > > 1. ...
5 years, 8 months ago (2015-04-08 00:09:57 UTC) #20
felt
and i always forget to mail my comments https://codereview.chromium.org/1049533002/diff/80001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/80001/url/gurl.h#newcode229 url/gurl.h:229: // ...
5 years, 8 months ago (2015-04-08 00:10:08 UTC) #21
palmer
Additional documentation of content::IsOriginSecure and IsOriginSecure in chrome/. https://codereview.chromium.org/1049533002/diff/80001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/80001/url/gurl.h#newcode229 url/gurl.h:229: // ...
5 years, 8 months ago (2015-04-08 00:50:07 UTC) #22
davidben
https://codereview.chromium.org/1049533002/diff/120001/chrome/common/origin_util.h File chrome/common/origin_util.h (right): https://codereview.chromium.org/1049533002/diff/120001/chrome/common/origin_util.h#newcode15 chrome/common/origin_util.h:15: // See https://www.w3.org/TR/powerful-features/#is-origin-trustworthy. Having both chrome:: and content:: versions ...
5 years, 8 months ago (2015-04-08 20:31:00 UTC) #24
palmer
On 2015/04/08 20:31:00, David Benjamin wrote: > Having both chrome:: and content:: versions of this ...
5 years, 8 months ago (2015-04-08 20:35:49 UTC) #25
davidben
Sorry, that was probably unclear. On 2015/04/08 20:35:49, palmer wrote: > On 2015/04/08 20:31:00, David ...
5 years, 8 months ago (2015-04-08 20:58:51 UTC) #26
palmer
On 2015/04/08 20:58:51, David Benjamin wrote: > Right, so some API //content exposes to //chrome ...
5 years, 8 months ago (2015-04-08 21:54:57 UTC) #27
davidben
On 2015/04/08 21:54:57, palmer wrote: > On 2015/04/08 20:58:51, David Benjamin wrote: > > > ...
5 years, 8 months ago (2015-04-08 22:05:30 UTC) #28
brettw
I think the problem is that this patch is too hard to discuss without seeing ...
5 years, 8 months ago (2015-04-08 22:13:28 UTC) #29
palmer
> If the intent is for it to just be an implementation detail of > ...
5 years, 8 months ago (2015-04-14 20:24:18 UTC) #30
palmer
PTAL, and a CL with some callers is on the way.
5 years, 8 months ago (2015-04-14 22:27:35 UTC) #31
palmer
First caller: https://codereview.chromium.org/1087983002/
5 years, 8 months ago (2015-04-14 22:37:19 UTC) #32
palmer
Some callers for GURL::SchemeUsesTLS: https://codereview.chromium.org/1082083004
5 years, 8 months ago (2015-04-15 00:22:37 UTC) #33
estark
https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc File chrome/common/origin_util.cc (right): https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc#newcode22 chrome/common/origin_util.cc:22: if (net::IsLocalhost(hostname) || net::IsLocalhostTLD(hostname)) Was just looking at this ...
5 years, 8 months ago (2015-04-15 00:35:53 UTC) #35
markusheintz_
https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc File chrome/common/origin_util.cc (right): https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc#newcode13 chrome/common/origin_util.cc:13: if (url.SchemeUsesTLS() || url.SchemeIsFile()) hm ... I may remember ...
5 years, 8 months ago (2015-04-15 14:12:36 UTC) #37
markusheintz_
https://codereview.chromium.org/1049533002/diff/140001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/140001/url/gurl.h#newcode248 url/gurl.h:248: // |content::IsOriginSecure| and |IsOriginSecure| for a higher-level and more ...
5 years, 8 months ago (2015-04-15 14:15:09 UTC) #38
davidben
looks good modulo the various comments on comments (hah). Though I don't think I'm useful ...
5 years, 8 months ago (2015-04-15 15:45:40 UTC) #39
palmer
Thanks all! https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc File chrome/common/origin_util.cc (right): https://codereview.chromium.org/1049533002/diff/140001/chrome/common/origin_util.cc#newcode13 chrome/common/origin_util.cc:13: if (url.SchemeUsesTLS() || url.SchemeIsFile()) > hm ...
5 years, 8 months ago (2015-04-16 17:15:40 UTC) #40
palmer
OK, PTAL. Perhaps this CL is ready to fly?
5 years, 8 months ago (2015-04-16 17:17:33 UTC) #41
davidben
lgtm https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h#newcode235 url/gurl.h:235: // |content::IsOriginSecure|, as appropriate. Then remove |SchemeIsSecure|. Missed ...
5 years, 8 months ago (2015-04-16 17:20:36 UTC) #42
palmer
https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h#newcode235 url/gurl.h:235: // |content::IsOriginSecure|, as appropriate. Then remove |SchemeIsSecure|. On 2015/04/16 ...
5 years, 8 months ago (2015-04-16 17:26:07 UTC) #43
markusheintz_
On 2015/04/16 17:26:07, palmer wrote: > https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h > File url/gurl.h (right): > > https://codereview.chromium.org/1049533002/diff/160001/url/gurl.h#newcode235 > ...
5 years, 8 months ago (2015-04-16 17:44:12 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1049533002/180001
5 years, 8 months ago (2015-04-16 18:03:02 UTC) #47
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 8 months ago (2015-04-16 19:23:43 UTC) #48
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/6c3473c3489dae0bfd2133c22e6b5cd9fb4f5fef Cr-Commit-Position: refs/heads/master@{#325495}
5 years, 8 months ago (2015-04-16 19:24:45 UTC) #49
Ryan Sleevi
https://codereview.chromium.org/1049533002/diff/180001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/1049533002/diff/180001/url/gurl.h#newcode249 url/gurl.h:249: bool SchemeUsesTLS() const { Suuuuuper-annoying pedantry: These schemes could ...
5 years, 8 months ago (2015-04-16 19:39:35 UTC) #51
palmer
SchemeIsCryptographic?
5 years, 8 months ago (2015-04-20 22:52:21 UTC) #52
felt
On 2015/04/20 22:52:21, palmer wrote: > SchemeIsCryptographic? while we're painting a bikeshed, I'm in favor ...
5 years, 8 months ago (2015-04-20 23:32:28 UTC) #53
palmer
> while we're painting a bikeshed, I'm in favor of SchemeUsesSecureTransport, or > SchemeIsNetworkSecure ;) ...
5 years, 8 months ago (2015-04-20 23:56:43 UTC) #54
Ryan Sleevi
5 years, 8 months ago (2015-04-21 09:57:33 UTC) #55
Message was sent while issue was closed.
On 2015/04/20 23:56:43, palmer wrote:
> Also a good bikeshed should have eaves sheltering a little tire pump station.
> And a flower pot.

Joking aside, I'm not sure I think of the filesystem as a "transport", hence why
I suggested SecureTransport. I mean, arguably "SchemeIsTransportLayerSecure" is
a viable read, it's just that the "transport layer security" isn't "Transport
Layer Security"... 

I'm admittedly understandably nervous about saying "secure", since "crap TLS" is
one of those "a little of column a, a little of column b" cases.

SchemeIsCryptographic works, but I fear that will be overloaded with something
like .onion / .iot things (which are host, not scheme, but since when has that
distinction ever mattered when reading code...)

I still lean on "SchemeIsNetworkSecure", but I mean, ultimately this is pedantry
that won't really become an issue until we're more standardizing QUIC.

Powered by Google App Engine
This is Rietveld 408576698