Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsCOMPtr.h" |
michael@0 | 7 | #include "nsIGeolocationProvider.h" |
michael@0 | 8 | |
michael@0 | 9 | /* |
michael@0 | 10 | * The CoreLocationObjects class contains the CoreLocation objects |
michael@0 | 11 | * we'll need. |
michael@0 | 12 | * |
michael@0 | 13 | * Declaring them directly in CoreLocationLocationProvider |
michael@0 | 14 | * would require Objective-C++ syntax, which would contaminate all |
michael@0 | 15 | * files that include this header and require them to be Objective-C++ |
michael@0 | 16 | * as well. |
michael@0 | 17 | * |
michael@0 | 18 | * The solution then is to forward-declare CoreLocationObjects here and |
michael@0 | 19 | * hold a pointer to it in CoreLocationLocationProvider, and only actually |
michael@0 | 20 | * define it in CoreLocationLocationProvider.mm, thus making it safe |
michael@0 | 21 | * for nsGeolocation.cpp, which is C++-only, to include this header. |
michael@0 | 22 | */ |
michael@0 | 23 | class CoreLocationObjects; |
michael@0 | 24 | |
michael@0 | 25 | class CoreLocationLocationProvider |
michael@0 | 26 | : public nsIGeolocationProvider |
michael@0 | 27 | { |
michael@0 | 28 | public: |
michael@0 | 29 | NS_DECL_ISUPPORTS |
michael@0 | 30 | NS_DECL_NSIGEOLOCATIONPROVIDER |
michael@0 | 31 | |
michael@0 | 32 | CoreLocationLocationProvider(); |
michael@0 | 33 | void NotifyError(uint16_t aErrorCode); |
michael@0 | 34 | void Update(nsIDOMGeoPosition* aSomewhere); |
michael@0 | 35 | private: |
michael@0 | 36 | virtual ~CoreLocationLocationProvider() {}; |
michael@0 | 37 | |
michael@0 | 38 | CoreLocationObjects* mCLObjects; |
michael@0 | 39 | nsCOMPtr<nsIGeolocationUpdate> mCallback; |
michael@0 | 40 | }; |