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

Unified Diff: Source/modules/geolocation/GeolocationController.cpp

Issue 30363003: Fix crash in GeolocationController when the page gets destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/geolocation/GeolocationController.cpp
diff --git a/Source/modules/geolocation/GeolocationController.cpp b/Source/modules/geolocation/GeolocationController.cpp
index 1956eec6345fe9529451a4a5ae5c6e66895f6776..7c80533571d6fa4718d5f0ab4e8bd281191344be 100644
--- a/Source/modules/geolocation/GeolocationController.cpp
+++ b/Source/modules/geolocation/GeolocationController.cpp
@@ -64,7 +64,7 @@ void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc
if (m_client) {
if (enableHighAccuracy)
m_client->setEnableHighAccuracy(true);
- if (wasEmpty && page()->visibilityState() == PageVisibilityStateVisible)
+ if (wasEmpty && page() && page()->visibilityState() == PageVisibilityStateVisible)
m_client->startUpdating();
}
}
@@ -135,7 +135,7 @@ void GeolocationController::pageVisibilityChanged()
if (m_observers.isEmpty() || !m_client)
return;
- if (page()->visibilityState() == PageVisibilityStateVisible)
+ if (page() && page()->visibilityState() == PageVisibilityStateVisible)
adamk 2013/10/23 15:34:38 I'd hope that page() couldn't be null here, since
m_client->startUpdating();
else
m_client->stopUpdating();
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698