| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
| 4 * Copyright 2010, The Android Open Source Project | 4 * Copyright 2010, The Android Open Source Project |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 code = PositionError::PERMISSION_DENIED; | 70 code = PositionError::PERMISSION_DENIED; |
| 71 break; | 71 break; |
| 72 case GeolocationError::PositionUnavailable: | 72 case GeolocationError::PositionUnavailable: |
| 73 code = PositionError::POSITION_UNAVAILABLE; | 73 code = PositionError::POSITION_UNAVAILABLE; |
| 74 break; | 74 break; |
| 75 } | 75 } |
| 76 | 76 |
| 77 return PositionError::create(code, error->message()); | 77 return PositionError::create(code, error->message()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DEFINE_GC_INFO(Geolocation::GeoNotifier); | |
| 81 | |
| 82 Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassOwnPtr<Posit
ionCallback> successCallback, PassOwnPtr<PositionErrorCallback> errorCallback, P
assRefPtrWillBeRawPtr<PositionOptions> options) | 80 Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassOwnPtr<Posit
ionCallback> successCallback, PassOwnPtr<PositionErrorCallback> errorCallback, P
assRefPtrWillBeRawPtr<PositionOptions> options) |
| 83 : m_geolocation(geolocation) | 81 : m_geolocation(geolocation) |
| 84 , m_successCallback(successCallback) | 82 , m_successCallback(successCallback) |
| 85 , m_errorCallback(errorCallback) | 83 , m_errorCallback(errorCallback) |
| 86 , m_options(options) | 84 , m_options(options) |
| 87 , m_timer(this, &Geolocation::GeoNotifier::timerFired) | 85 , m_timer(this, &Geolocation::GeoNotifier::timerFired) |
| 88 , m_useCachedPosition(false) | 86 , m_useCachedPosition(false) |
| 89 { | 87 { |
| 90 ASSERT(m_geolocation); | 88 ASSERT(m_geolocation); |
| 91 ASSERT(m_successCallback); | 89 ASSERT(m_successCallback); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 bool Geolocation::Watchers::isEmpty() const | 242 bool Geolocation::Watchers::isEmpty() const |
| 245 { | 243 { |
| 246 return m_idToNotifierMap.isEmpty(); | 244 return m_idToNotifierMap.isEmpty(); |
| 247 } | 245 } |
| 248 | 246 |
| 249 void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const | 247 void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const |
| 250 { | 248 { |
| 251 copyValuesToVector(m_idToNotifierMap, copy); | 249 copyValuesToVector(m_idToNotifierMap, copy); |
| 252 } | 250 } |
| 253 | 251 |
| 254 DEFINE_GC_INFO(Geolocation); | |
| 255 | |
| 256 PassRefPtrWillBeRawPtr<Geolocation> Geolocation::create(ExecutionContext* contex
t) | 252 PassRefPtrWillBeRawPtr<Geolocation> Geolocation::create(ExecutionContext* contex
t) |
| 257 { | 253 { |
| 258 RefPtrWillBeRawPtr<Geolocation> geolocation = adoptRefWillBeNoop(new Geoloca
tion(context)); | 254 RefPtrWillBeRawPtr<Geolocation> geolocation = adoptRefWillBeNoop(new Geoloca
tion(context)); |
| 259 geolocation->suspendIfNeeded(); | 255 geolocation->suspendIfNeeded(); |
| 260 return geolocation.release(); | 256 return geolocation.release(); |
| 261 } | 257 } |
| 262 | 258 |
| 263 Geolocation::Geolocation(ExecutionContext* context) | 259 Geolocation::Geolocation(ExecutionContext* context) |
| 264 : ActiveDOMObject(context) | 260 : ActiveDOMObject(context) |
| 265 , m_allowGeolocation(Unknown) | 261 , m_allowGeolocation(Unknown) |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 notifier->startTimerIfNeeded(); | 701 notifier->startTimerIfNeeded(); |
| 706 else | 702 else |
| 707 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); | 703 notifier->setFatalError(PositionError::create(PositionError::POS
ITION_UNAVAILABLE, failedToStartServiceErrorMessage)); |
| 708 } else { | 704 } else { |
| 709 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); | 705 notifier->setFatalError(PositionError::create(PositionError::PERMISS
ION_DENIED, permissionDeniedErrorMessage)); |
| 710 } | 706 } |
| 711 } | 707 } |
| 712 } | 708 } |
| 713 | 709 |
| 714 } // namespace WebCore | 710 } // namespace WebCore |
| OLD | NEW |