| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef GeolocationInspectorAgent_h | 31 #ifndef GeolocationInspectorAgent_h |
| 32 #define GeolocationInspectorAgent_h | 32 #define GeolocationInspectorAgent_h |
| 33 | 33 |
| 34 | 34 |
| 35 #include "core/inspector/InspectorBaseAgent.h" | 35 #include "core/inspector/InspectorBaseAgent.h" |
| 36 #include "modules/geolocation/GeolocationPosition.h" | 36 #include "modules/geolocation/GeolocationPosition.h" |
| 37 #include "wtf/HashMap.h" | 37 #include "wtf/HashSet.h" |
| 38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 class GeolocationController; | 42 class GeolocationController; |
| 43 | 43 |
| 44 typedef String ErrorString; | 44 typedef String ErrorString; |
| 45 | 45 |
| 46 class GeolocationInspectorAgent FINAL : public InspectorBaseAgent<GeolocationIns
pectorAgent>, public InspectorBackendDispatcher::GeolocationCommandHandler { | 46 class GeolocationInspectorAgent FINAL : public InspectorBaseAgent<GeolocationIns
pectorAgent>, public InspectorBackendDispatcher::GeolocationCommandHandler { |
| 47 WTF_MAKE_NONCOPYABLE(GeolocationInspectorAgent); | 47 WTF_MAKE_NONCOPYABLE(GeolocationInspectorAgent); |
| 48 public: | 48 public: |
| 49 static PassOwnPtr<GeolocationInspectorAgent> create(GeolocationController*); | 49 static PassOwnPtr<GeolocationInspectorAgent> create(); |
| 50 virtual ~GeolocationInspectorAgent(); | 50 virtual ~GeolocationInspectorAgent(); |
| 51 | 51 |
| 52 // Protocol methods. | 52 // Protocol methods. |
| 53 virtual void setGeolocationOverride(ErrorString*, const double*, const doubl
e*, const double*) OVERRIDE; | 53 virtual void setGeolocationOverride(ErrorString*, const double*, const doubl
e*, const double*) OVERRIDE; |
| 54 virtual void clearGeolocationOverride(ErrorString*) OVERRIDE; | 54 virtual void clearGeolocationOverride(ErrorString*) OVERRIDE; |
| 55 | 55 |
| 56 // Instrumentation method. | 56 // Instrumentation method. |
| 57 GeolocationPosition* overrideGeolocationPosition(GeolocationPosition*); | 57 GeolocationPosition* overrideGeolocationPosition(GeolocationPosition*); |
| 58 | 58 |
| 59 void AddController(GeolocationController*); |
| 60 void RemoveController(GeolocationController*); |
| 61 |
| 59 private: | 62 private: |
| 60 explicit GeolocationInspectorAgent(GeolocationController*); | 63 GeolocationInspectorAgent(); |
| 61 GeolocationController* m_controller; | 64 WTF::HashSet<GeolocationController*> m_controllers; |
| 62 bool m_geolocationOverridden; | 65 bool m_geolocationOverridden; |
| 63 RefPtrWillBePersistent<GeolocationPosition> m_geolocationPosition; | 66 RefPtrWillBePersistent<GeolocationPosition> m_geolocationPosition; |
| 64 RefPtrWillBePersistent<GeolocationPosition> m_platformGeolocationPosition; | 67 RefPtrWillBePersistent<GeolocationPosition> m_platformGeolocationPosition; |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 | 70 |
| 68 } // namespace WebCore | 71 } // namespace WebCore |
| 69 | 72 |
| 70 | 73 |
| 71 #endif // !defined(GeolocationInspectorAgent_h) | 74 #endif // !defined(GeolocationInspectorAgent_h) |
| OLD | NEW |