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 8df54b66af383e0d287fea4278426abf8424a087..a7893f2d3f678258aab90a1cd9b7a122c4645659 100644 |
--- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp |
+++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp |
@@ -36,6 +36,7 @@ |
#include "platform/UserGestureIndicator.h" |
#include "platform/mojo/MojoHelper.h" |
#include "public/platform/InterfaceProvider.h" |
+#include "public/platform/Platform.h" |
#include "wtf/Assertions.h" |
#include "wtf/CurrentTime.h" |
@@ -525,6 +526,13 @@ void Geolocation::pageVisibilityChanged() |
void Geolocation::onGeolocationConnectionError() |
{ |
+ // If a request is outstanding at process shutdown, this error handler will |
+ // be called. In that case, blink has already shut down so do nothing. |
+ // |
+ // TODO(sammc): Remove this once renderer shutdown is no longer graceful. |
+ if (!Platform::current()) |
+ return; |
+ |
PositionError* error = PositionError::create(PositionError::kPositionUnavailable, failedToStartServiceErrorMessage); |
error->setIsFatal(true); |
handleError(error); |
@@ -532,6 +540,13 @@ void Geolocation::onGeolocationConnectionError() |
void Geolocation::onPermissionConnectionError() |
{ |
+ // If a request is outstanding at process shutdown, this error handler will |
+ // be called. In that case, blink has already shut down so do nothing. |
+ // |
+ // TODO(sammc): Remove this once renderer shutdown is no longer graceful. |
+ if (!Platform::current()) |
+ return; |
+ |
onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
} |