|
|
Created:
6 years, 2 months ago by mlamouri (slow - plz ping) Modified:
6 years, 2 months ago CC:
blink-reviews, mvanouwerkerk+watch_chromium.org, timvolodine Base URL:
https://chromium.googlesource.com/chromium/blink.git@screen_orientation_use_counter Project:
blink Visibility:
Public. |
DescriptionRecord whether Geolocation is accessed from a secure origin.
BUG=352380
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183149
Patch Set 1 #
Total comments: 6
Patch Set 2 : nits #
Total comments: 3
Patch Set 3 : nits #
Messages
Total messages: 23 (6 generated)
mlamouri@chromium.org changed reviewers: + mvanouwerkerk@chromium.org
mkwst@chromium.org changed reviewers: + mkwst@chromium.org
LGTM. Thanks for taking care of this.
peter@chromium.org changed reviewers: + peter@chromium.org
https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... File Source/modules/geolocation/Geolocation.cpp (right): https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.cpp:146: if (!document) When would there not be a document if we have the frame? We seem to assume in other places (e.g. Geolocation::watchPosition) that the executionContext() is alive. Can we ASSERT instead? https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.cpp:155: UseCounter::count(document, counter); I would much prefer this code to use SecurityOrigin::isSecure() based on the document's URL. Right now, it would consider localhost URLs as being secure either, which I don't think we should include in the UMA. https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... File Source/modules/geolocation/Geolocation.h (right): https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.h:170: void RecordOriginTypeAccess(); nit: Should start with a lower-case character per the Blink style-guide.
Thanks. I think part of the discussion was also about whether the permission grant / reject rate was affected by origin security. This could be tracked generically in the browser process for all permission requests for all APIs. Would you like to tackle that as well? :-)
https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... File Source/modules/geolocation/Geolocation.cpp (right): https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.cpp:155: UseCounter::count(document, counter); On 2014/10/02 14:58:24, Peter Beverloo wrote: > I would much prefer this code to use SecurityOrigin::isSecure() based on the > document's URL. Right now, it would consider localhost URLs as being secure > either, which I don't think we should include in the UMA. We're using canAccessFeature* for security checks (like ServiceWorker) now. If that's the definition we're running with, it's what we should measure.
On 2014/10/02 15:04:11, Mike West (OOO until 6th) wrote: > https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... > File Source/modules/geolocation/Geolocation.cpp (right): > > https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... > Source/modules/geolocation/Geolocation.cpp:155: UseCounter::count(document, > counter); > On 2014/10/02 14:58:24, Peter Beverloo wrote: > > I would much prefer this code to use SecurityOrigin::isSecure() based on the > > document's URL. Right now, it would consider localhost URLs as being secure > > either, which I don't think we should include in the UMA. > > We're using canAccessFeature* for security checks (like ServiceWorker) now. If > that's the definition we're running with, it's what we should measure. Do we consider every localhost URL to be a secure origin, even when using HTTP? The UMA names explicitly focus on whether the origin is secure or not, so perhaps we should settle on a more accurate name instead?
On 2014/10/02 15:07:35, Peter Beverloo wrote: > Do we consider every localhost URL to be a secure origin, even when using HTTP? Yes. Chrome has to trust the local machine. Loopback addresses, file:/// addresses, etc. are "secure" for purposes of this API call. > The UMA names explicitly focus on whether the origin is secure or not, so > perhaps we should settle on a more accurate name instead? The mixed content spec calls them "authenticated origins". palmer@ calls them "secure origins". Pick your poison. :)
On 2014/10/02 15:10:57, Mike West (OOO until 6th) wrote: > On 2014/10/02 15:07:35, Peter Beverloo wrote: > > Do we consider every localhost URL to be a secure origin, even when using > HTTP? > > Yes. Chrome has to trust the local machine. Loopback addresses, file:/// > addresses, etc. are "secure" for purposes of this API call. > > > The UMA names explicitly focus on whether the origin is secure or not, so > > perhaps we should settle on a more accurate name instead? > > The mixed content spec calls them "authenticated origins". palmer@ calls them > "secure origins". Pick your poison. :) OK, sounds good to me then! Thanks. (My other comments still stand.)
lgtm since they're nits
https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... File Source/modules/geolocation/Geolocation.cpp (right): https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.cpp:146: if (!document) On 2014/10/02 14:58:24, Peter Beverloo wrote: > When would there not be a document if we have the frame? We seem to assume in > other places (e.g. Geolocation::watchPosition) that the executionContext() is > alive. Can we ASSERT instead? Done. https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... File Source/modules/geolocation/Geolocation.h (right): https://codereview.chromium.org/620003005/diff/1/Source/modules/geolocation/G... Source/modules/geolocation/Geolocation.h:170: void RecordOriginTypeAccess(); On 2014/10/02 14:58:24, Peter Beverloo wrote: > nit: Should start with a lower-case character per the Blink style-guide. Done.
lgtm with nits https://codereview.chromium.org/620003005/diff/20001/Source/modules/geolocati... File Source/modules/geolocation/Geolocation.cpp (right): https://codereview.chromium.org/620003005/diff/20001/Source/modules/geolocati... Source/modules/geolocation/Geolocation.cpp:145: Document* doc = document(); Please don't use abbreviations for variables without good reason. Just call this 'document' - it's still short. https://codereview.chromium.org/620003005/diff/20001/Source/modules/geolocati... Source/modules/geolocation/Geolocation.cpp:148: // It is required but canAccessFeatureRequiringSecureOrigin() but isn't but but?
https://codereview.chromium.org/620003005/diff/20001/Source/modules/geolocati... File Source/modules/geolocation/Geolocation.cpp (right): https://codereview.chromium.org/620003005/diff/20001/Source/modules/geolocati... Source/modules/geolocation/Geolocation.cpp:148: // It is required but canAccessFeatureRequiringSecureOrigin() but isn't On 2014/10/02 15:47:26, Michael van Ouwerkerk wrote: > but but? s/canAccessFeatureRequiringSecureOrigin()/insecureOriginMsg/
nits fixed, PTAL
The CQ bit was checked by mlamouri@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/620003005/40001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for Source/core/frame/UseCounter.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file Source/core/frame/UseCounter.h Hunk #1 FAILED at 527. 1 out of 1 hunk FAILED -- saving rejects to file Source/core/frame/UseCounter.h.rej Patch: Source/core/frame/UseCounter.h Index: Source/core/frame/UseCounter.h diff --git a/Source/core/frame/UseCounter.h b/Source/core/frame/UseCounter.h index dd58eeff268663d0111953ea45ec6a6deeb3974b..d0c237f0f1e7efbf5997653235a64f74ddbbb342 100644 --- a/Source/core/frame/UseCounter.h +++ b/Source/core/frame/UseCounter.h @@ -527,6 +527,8 @@ public: ScreenOrientationType = 558, ScreenOrientationLock = 559, ScreenOrientationUnlock = 560, + GeolocationSecureOrigin = 561, + GeolocationInsecureOrigin = 562, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots. // Also, run update_use_counter_feature_enum.py in chromium/src/tools/metrics/histograms/
The CQ bit was checked by mlamouri@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/620003005/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as 183149 |