Chromium Code Reviews| 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() |