Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef __TCPDeviceInfo_h__
8 : #define __TCPDeviceInfo_h__
9 :
10 : namespace mozilla {
11 : namespace dom {
12 : namespace presentation {
13 :
14 : class TCPDeviceInfo final : public nsITCPDeviceInfo
15 : {
16 : public:
17 : NS_DECL_ISUPPORTS
18 : NS_DECL_NSITCPDEVICEINFO
19 :
20 0 : explicit TCPDeviceInfo(const nsACString& aId,
21 : const nsACString& aAddress,
22 : const uint16_t aPort,
23 : const nsACString& aCertFingerprint)
24 0 : : mId(aId)
25 : , mAddress(aAddress)
26 : , mPort(aPort)
27 0 : , mCertFingerprint(aCertFingerprint)
28 : {
29 0 : }
30 :
31 : private:
32 0 : virtual ~TCPDeviceInfo() {}
33 :
34 : nsCString mId;
35 : nsCString mAddress;
36 : uint16_t mPort;
37 : nsCString mCertFingerprint;
38 : };
39 :
40 0 : NS_IMPL_ISUPPORTS(TCPDeviceInfo,
41 : nsITCPDeviceInfo)
42 :
43 : // nsITCPDeviceInfo
44 : NS_IMETHODIMP
45 0 : TCPDeviceInfo::GetId(nsACString& aId)
46 : {
47 0 : aId = mId;
48 0 : return NS_OK;
49 : }
50 :
51 : NS_IMETHODIMP
52 0 : TCPDeviceInfo::GetAddress(nsACString& aAddress)
53 : {
54 0 : aAddress = mAddress;
55 0 : return NS_OK;
56 : }
57 :
58 : NS_IMETHODIMP
59 0 : TCPDeviceInfo::GetPort(uint16_t* aPort)
60 : {
61 0 : *aPort = mPort;
62 0 : return NS_OK;
63 : }
64 :
65 : NS_IMETHODIMP
66 0 : TCPDeviceInfo::GetCertFingerprint(nsACString& aCertFingerprint)
67 : {
68 0 : aCertFingerprint = mCertFingerprint;
69 0 : return NS_OK;
70 : }
71 :
72 : } // namespace presentation
73 : } // namespace dom
74 : } // namespace mozilla
75 :
76 : #endif /* !__TCPDeviceInfo_h__ */
77 :
|