| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 public: | 48 public: |
| 49 GeolocationClientMock(); | 49 GeolocationClientMock(); |
| 50 virtual ~GeolocationClientMock(); | 50 virtual ~GeolocationClientMock(); |
| 51 | 51 |
| 52 void setPosition(GeolocationPosition*); | 52 void setPosition(GeolocationPosition*); |
| 53 void setPositionUnavailableError(const String& errorMessage); | 53 void setPositionUnavailableError(const String& errorMessage); |
| 54 void setPermission(bool allowed); | 54 void setPermission(bool allowed); |
| 55 int numberOfPendingPermissionRequests() const; | 55 int numberOfPendingPermissionRequests() const; |
| 56 | 56 |
| 57 // GeolocationClient | 57 // GeolocationClient |
| 58 virtual void geolocationDestroyed() OVERRIDE; | |
| 59 virtual void startUpdating() OVERRIDE; | 58 virtual void startUpdating() OVERRIDE; |
| 60 virtual void stopUpdating() OVERRIDE; | 59 virtual void stopUpdating() OVERRIDE; |
| 61 virtual void setEnableHighAccuracy(bool) OVERRIDE; | 60 virtual void setEnableHighAccuracy(bool) OVERRIDE; |
| 62 virtual GeolocationPosition* lastPosition() OVERRIDE; | 61 virtual GeolocationPosition* lastPosition() OVERRIDE; |
| 63 virtual void requestPermission(Geolocation*) OVERRIDE; | 62 virtual void requestPermission(Geolocation*) OVERRIDE; |
| 64 virtual void cancelPermissionRequest(Geolocation*) OVERRIDE; | 63 virtual void cancelPermissionRequest(Geolocation*) OVERRIDE; |
| 65 void controllerForTestAdded(GeolocationController*) OVERRIDE; | 64 void controllerForTestAdded(GeolocationController*) OVERRIDE; |
| 66 void controllerForTestRemoved(GeolocationController*) OVERRIDE; | 65 void controllerForTestRemoved(GeolocationController*) OVERRIDE; |
| 67 | 66 |
| 67 virtual void trace(Visitor*) OVERRIDE; |
| 68 |
| 68 private: | 69 private: |
| 69 void asyncUpdateController(); | 70 void asyncUpdateController(); |
| 70 void controllerTimerFired(Timer<GeolocationClientMock>*); | 71 void controllerTimerFired(Timer<GeolocationClientMock>*); |
| 71 | 72 |
| 72 void asyncUpdatePermission(); | 73 void asyncUpdatePermission(); |
| 73 void permissionTimerFired(Timer<GeolocationClientMock>*); | 74 void permissionTimerFired(Timer<GeolocationClientMock>*); |
| 74 | 75 |
| 75 void clearError(); | 76 void clearError(); |
| 76 | 77 |
| 77 typedef WillBeHeapHashSet<RawPtrWillBeMember<GeolocationController> > Geoloc
ationControllers; | 78 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<GeolocationController> > Ge
olocationControllers; |
| 78 WillBePersistentHeapHashSet<RawPtrWillBeMember<GeolocationController> > m_co
ntrollers; | 79 GeolocationControllers m_controllers; |
| 79 Persistent<GeolocationPosition> m_lastPosition; | 80 |
| 81 PersistentWillBeMember<GeolocationPosition> m_lastPosition; |
| 80 bool m_hasError; | 82 bool m_hasError; |
| 81 String m_errorMessage; | 83 String m_errorMessage; |
| 82 Timer<GeolocationClientMock> m_controllerTimer; | 84 Timer<GeolocationClientMock> m_controllerTimer; |
| 83 Timer<GeolocationClientMock> m_permissionTimer; | 85 Timer<GeolocationClientMock> m_permissionTimer; |
| 84 bool m_isActive; | 86 bool m_isActive; |
| 85 | 87 |
| 86 enum PermissionState { | 88 enum PermissionState { |
| 87 PermissionStateUnset, | 89 PermissionStateUnset, |
| 88 PermissionStateAllowed, | 90 PermissionStateAllowed, |
| 89 PermissionStateDenied | 91 PermissionStateDenied |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 PermissionState m_permissionState; | 94 PermissionState m_permissionState; |
| 93 typedef HeapHashSet<Member<Geolocation> > GeolocationSet; | 95 |
| 94 PersistentHeapHashSet<Member<Geolocation> > m_pendingPermissions; | 96 typedef PersistentHeapHashSetWillBeHeapHashSet<Member<Geolocation> > Geoloca
tionSet; |
| 97 GeolocationSet m_pendingPermissions; |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 } | 100 } |
| 98 | 101 |
| 99 #endif | 102 #endif |
| OLD | NEW |