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

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

Issue 1515103003: Revert of Removal of geolocation APIs on insecure origins (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a07d05914a4e8c44a8e1bf2d6a1c8a5ce16e497..0b107f98e7dd36f0d7e931346efd508ebff063d9 100644
--- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
+++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
@@ -169,6 +169,8 @@
if (!frame())
return;
+ recordOriginTypeAccess();
+
GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier);
@@ -179,6 +181,8 @@
{
if (!frame())
return 0;
+
+ recordOriginTypeAccess();
GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier);
@@ -193,11 +197,12 @@
void Geolocation::startRequest(GeoNotifier *notifier)
{
- recordOriginTypeAccess();
- String errorMessage;
- if (!executionContext()->isSecureContext(errorMessage)) {
- notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, errorMessage));
- return;
+ if (frame()->settings()->strictPowerfulFeatureRestrictions()) {
+ String errorMessage;
+ if (!executionContext()->isSecureContext(errorMessage)) {
+ notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, errorMessage));
+ return;
+ }
}
if (RuntimeEnabledFeatures::restrictIFramePermissionsEnabled()) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698