Chromium Code Reviews| 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 bccab75711e7d38917d779f3e005a81f1487e61a..daeb5dba37a4c83a2b53e047cf2bf4c8a3ef8740 100644 |
| --- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp |
| +++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp |
| @@ -35,6 +35,7 @@ |
| #include "modules/geolocation/GeolocationError.h" |
| #include "platform/UserGestureIndicator.h" |
| #include "platform/mojo/MojoHelper.h" |
| +#include "public/platform/Platform.h" |
| #include "public/platform/ServiceRegistry.h" |
| #include "wtf/Assertions.h" |
| #include "wtf/CurrentTime.h" |
| @@ -526,6 +527,12 @@ void Geolocation::pageVisibilityChanged() |
| void Geolocation::onGeolocationConnectionError() |
| { |
| + // If a request is outstanding at process shutdown, this error handler will |
| + // be called. In that case, |this| is not really in a good state so do |
| + // nothing. |
| + if (!Platform::current()) |
|
haraken
2016/07/20 07:15:01
It looks nasty to have this kind of check in Blink
Michael van Ouwerkerk
2016/07/20 09:40:50
This does seem a little out of place. It seems tha
|
| + return; |
| + |
| PositionError* error = PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage); |
| error->setIsFatal(true); |
| handleError(error); |
| @@ -533,6 +540,12 @@ void Geolocation::onGeolocationConnectionError() |
| void Geolocation::onPermissionConnectionError() |
| { |
| + // If a request is outstanding at process shutdown, this error handler will |
| + // be called. In that case, |this| is not really in a good state so do |
| + // nothing. |
| + if (!Platform::current()) |
| + return; |
| + |
| onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
| } |