Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/toolkit/components/telemetry/other/WebrtcTelemetry.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 WebrtcTelemetry_h__
8
#define WebrtcTelemetry_h__
9
10
#include "nsBaseHashtable.h"
11
#include "nsHashKeys.h"
12
#include "core/TelemetryCommon.h"
13
14
class WebrtcTelemetry {
15
public:
16
  struct WebrtcIceCandidateStats {
17
    uint32_t successCount;
18
    uint32_t failureCount;
19
    WebrtcIceCandidateStats() :
20
      successCount(0),
21
      failureCount(0)
22
0
    {
23
0
    }
24
  };
25
  struct WebrtcIceStatsCategory {
26
    struct WebrtcIceCandidateStats webrtc;
27
  };
28
  typedef nsBaseHashtableET<nsUint32HashKey, WebrtcIceStatsCategory> WebrtcIceCandidateType;
29
30
  void RecordIceCandidateMask(const uint32_t iceCandidateBitmask, bool success);
31
32
  bool GetWebrtcStats(JSContext *cx, JS::MutableHandle<JS::Value> ret);
33
34
  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
35
36
private:
37
38
  bool AddIceInfo(JSContext *cx, JS::Handle<JSObject*> rootObj);
39
40
  mozilla::Telemetry::Common::AutoHashtable<WebrtcIceCandidateType> mWebrtcIceCandidates;
41
};
42
43
#endif // WebrtcTelemetry_h__