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

Side by Side Diff: Source/modules/geolocation/GeolocationController.cpp

Issue 335573004: Oilpan: Notify supplements of Page and LocalFrame destruction. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase and null check 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 GeolocationController::~GeolocationController() 83 GeolocationController::~GeolocationController()
84 { 84 {
85 ASSERT(m_observers.isEmpty()); 85 ASSERT(m_observers.isEmpty());
86 if (page()) 86 if (page())
87 m_inspectorAgent->RemoveController(this); 87 m_inspectorAgent->RemoveController(this);
88 88
89 if (m_hasClientForTest) 89 if (m_hasClientForTest)
90 m_client->controllerForTestRemoved(this); 90 m_client->controllerForTestRemoved(this);
91 } 91 }
92 92
93 // FIXME: Oilpan: Once GeolocationClient is on-heap m_client should be a strong
94 // pointer and |willBeDestroyed| can potentially be removed from Supplement.
93 void GeolocationController::willBeDestroyed() 95 void GeolocationController::willBeDestroyed()
94 { 96 {
95 if (m_client) 97 if (m_client)
96 m_client->geolocationDestroyed(); 98 m_client->geolocationDestroyed();
97 } 99 }
98 100
101 void GeolocationController::persistentHostHasBeenDestroyed()
102 {
103 observeContext(0);
104 }
105
99 PassOwnPtrWillBeRawPtr<GeolocationController> GeolocationController::create(Loca lFrame& frame, GeolocationClient* client) 106 PassOwnPtrWillBeRawPtr<GeolocationController> GeolocationController::create(Loca lFrame& frame, GeolocationClient* client)
100 { 107 {
101 return adoptPtrWillBeNoop(new GeolocationController(frame, client)); 108 return adoptPtrWillBeNoop(new GeolocationController(frame, client));
102 } 109 }
103 110
104 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc curacy) 111 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc curacy)
105 { 112 {
106 // This may be called multiple times with the same observer, though removeOb server() 113 // This may be called multiple times with the same observer, though removeOb server()
107 // is called only once with each. 114 // is called only once with each.
108 bool wasEmpty = m_observers.isEmpty(); 115 bool wasEmpty = m_observers.isEmpty();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 visitor->trace(m_highAccuracyObservers); 219 visitor->trace(m_highAccuracyObservers);
213 WillBeHeapSupplement<LocalFrame>::trace(visitor); 220 WillBeHeapSupplement<LocalFrame>::trace(visitor);
214 } 221 }
215 222
216 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) 223 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client)
217 { 224 {
218 WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::su pplementName(), GeolocationController::create(frame, client)); 225 WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::su pplementName(), GeolocationController::create(frame, client));
219 } 226 }
220 227
221 } // namespace WebCore 228 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/geolocation/GeolocationController.h ('k') | Source/modules/screen_orientation/ScreenOrientationController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698