Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/presentation/provider/nsTCPDeviceInfo.h
Line
Count
Source (jump to first uncovered line)
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
  explicit TCPDeviceInfo(const nsACString& aId,
21
                         const nsACString& aAddress,
22
                         const uint16_t aPort,
23
                         const nsACString& aCertFingerprint)
24
    : mId(aId)
25
    , mAddress(aAddress)
26
    , mPort(aPort)
27
    , mCertFingerprint(aCertFingerprint)
28
0
  {
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
NS_IMPL_ISUPPORTS(TCPDeviceInfo,
41
                  nsITCPDeviceInfo)
42
43
// nsITCPDeviceInfo
44
NS_IMETHODIMP
45
TCPDeviceInfo::GetId(nsACString& aId)
46
0
{
47
0
  aId = mId;
48
0
  return NS_OK;
49
0
}
50
51
NS_IMETHODIMP
52
TCPDeviceInfo::GetAddress(nsACString& aAddress)
53
0
{
54
0
  aAddress = mAddress;
55
0
  return NS_OK;
56
0
}
57
58
NS_IMETHODIMP
59
TCPDeviceInfo::GetPort(uint16_t* aPort)
60
0
{
61
0
  *aPort = mPort;
62
0
  return NS_OK;
63
0
}
64
65
NS_IMETHODIMP
66
TCPDeviceInfo::GetCertFingerprint(nsACString& aCertFingerprint)
67
0
{
68
0
  aCertFingerprint = mCertFingerprint;
69
0
  return NS_OK;
70
0
}
71
72
} // namespace presentation
73
} // namespace dom
74
} // namespace mozilla
75
76
#endif /* !__TCPDeviceInfo_h__ */
77