| Index: Source/core/page/PageLifecycleNotifier.cpp
|
| diff --git a/Source/modules/geolocation/Coordinates.cpp b/Source/core/page/PageLifecycleNotifier.cpp
|
| similarity index 59%
|
| copy from Source/modules/geolocation/Coordinates.cpp
|
| copy to Source/core/page/PageLifecycleNotifier.cpp
|
| index 190a6ee3adf9f2925e1601238122bcf9522f9684..bd924b9d5cdc9781aa00a3d96984814029d27584 100644
|
| --- a/Source/modules/geolocation/Coordinates.cpp
|
| +++ b/Source/core/page/PageLifecycleNotifier.cpp
|
| @@ -20,48 +20,38 @@
|
| * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| +
|
| #include "config.h"
|
| -#include "modules/geolocation/Coordinates.h"
|
| +#include "core/page/PageLifecycleNotifier.h"
|
|
|
| namespace WebCore {
|
|
|
| -double Coordinates::altitude(bool& isNull) const
|
| +PageLifecycleNotifier::PageLifecycleNotifier(SimpleLifecycleContext* context)
|
| + : SimpleLifecycleNotifier(context)
|
| {
|
| - if (m_canProvideAltitude)
|
| - return m_altitude;
|
| -
|
| - isNull = true;
|
| - return 0;
|
| }
|
|
|
| -double Coordinates::altitudeAccuracy(bool& isNull) const
|
| +void PageLifecycleNotifier::addObserver(SimpleLifecycleObserver* observer, SimpleLifecycleObserver::Type type)
|
| {
|
| - if (m_canProvideAltitudeAccuracy)
|
| - return m_altitudeAccuracy;
|
| + if (type == SimpleLifecycleObserver::PageLifecycleObserverType) {
|
| + RELEASE_ASSERT(m_iterating != IteratingOverPageObservers);
|
| + m_pageObservers.add(static_cast<PageLifecycleObserver*>(observer));
|
| + }
|
|
|
| - isNull = true;
|
| - return 0;
|
| + SimpleLifecycleNotifier::addObserver(observer, type);
|
| }
|
|
|
| -double Coordinates::heading(bool& isNull) const
|
| +void PageLifecycleNotifier::removeObserver(SimpleLifecycleObserver* observer, SimpleLifecycleObserver::Type type)
|
| {
|
| - if (m_canProvideHeading)
|
| - return m_heading;
|
| + if (type == SimpleLifecycleObserver::PageLifecycleObserverType) {
|
| + RELEASE_ASSERT(m_iterating != IteratingOverPageObservers);
|
| + m_pageObservers.remove(static_cast<PageLifecycleObserver*>(observer));
|
| + }
|
|
|
| - isNull = true;
|
| - return 0;
|
| + SimpleLifecycleNotifier::removeObserver(observer, type);
|
| }
|
|
|
| -double Coordinates::speed(bool& isNull) const
|
| -{
|
| - if (m_canProvideSpeed)
|
| - return m_speed;
|
| -
|
| - isNull = true;
|
| - return 0;
|
| -}
|
| -
|
| } // namespace WebCore
|
|
|