Chromium Code Reviews

Unified Diff: third_party/WebKit/Source/modules/geolocation/Geolocation.cpp

Issue 1530403002: Removal of geolocation APIs on insecure origins (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Grammar fix Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
diff --git a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
index a4c056a99843c9741a33770f3db31497e4837b69..c39dc507b8c19f4eeb750d32de7af56ef3954e96 100644
--- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
+++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
@@ -168,8 +168,6 @@ void Geolocation::getCurrentPosition(PositionCallback* successCallback, Position
if (!frame())
return;
- recordOriginTypeAccess();
-
GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier);
@@ -181,8 +179,6 @@ int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorC
if (!frame())
return 0;
- recordOriginTypeAccess();
-
GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier);
@@ -196,12 +192,11 @@ int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorC
void Geolocation::startRequest(GeoNotifier *notifier)
{
- if (frame()->settings()->strictPowerfulFeatureRestrictions()) {
- String errorMessage;
- if (!executionContext()->isSecureContext(errorMessage)) {
- notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, errorMessage));
- return;
- }
+ recordOriginTypeAccess();
+ String errorMessage;
+ if (!frame()->settings()->allowGeolocationOnInsecureOrigins() && !executionContext()->isSecureContext(errorMessage)) {
+ notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, errorMessage));
+ return;
}
if (RuntimeEnabledFeatures::restrictIFramePermissionsEnabled()) {

Powered by Google App Engine