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

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

Issue 337053006: Oilpan: detach GeolocationController on being destroyed as a supplement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
Index: Source/modules/geolocation/GeolocationController.cpp
diff --git a/Source/modules/geolocation/GeolocationController.cpp b/Source/modules/geolocation/GeolocationController.cpp
index 213bb36efdb7c597b710cc99d11326824f42c11d..53458c4f325c1fa5ff7fce7e5042fa7fed214de8 100644
--- a/Source/modules/geolocation/GeolocationController.cpp
+++ b/Source/modules/geolocation/GeolocationController.cpp
@@ -83,19 +83,31 @@ void GeolocationController::stopUpdatingIfNeeded()
GeolocationController::~GeolocationController()
{
ASSERT(m_observers.isEmpty());
- if (page())
+ detach();
+}
+
+void GeolocationController::detach()
+{
+ if (page() && m_inspectorAgent) {
m_inspectorAgent->RemoveController(this);
haraken 2014/06/21 02:19:53 keishi@: I think you need to remove this code when
+ m_inspectorAgent = 0;
+ }
- if (m_hasClientForTest)
+ if (m_hasClientForTest) {
m_client->controllerForTestRemoved(this);
+ m_hasClientForTest = false;
+ }
}
// FIXME: Oilpan: Once GeolocationClient is on-heap m_client should be a strong
haraken 2014/06/21 02:19:53 We might want to consider moving GeolocationClient
// pointer and |willBeDestroyed| can potentially be removed from Supplement.
void GeolocationController::willBeDestroyed()
{
- if (m_client)
+ detach();
+ if (m_client) {
m_client->geolocationDestroyed();
+ m_client = 0;
+ }
}
void GeolocationController::persistentHostHasBeenDestroyed()

Powered by Google App Engine
This is Rietveld 408576698