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

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

Issue 2312553003: Revert of Remove Platform::current checks from Mojo's error handlers in geolocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 months 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 | « no previous file | 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 7b14da1bb8fdbe811a7ca521468de0c61d052180..cd8df3c870ffe60090e87a18ad276bf98cb8bf77 100644
--- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
+++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
@@ -526,6 +526,13 @@
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);
@@ -533,6 +540,13 @@
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698