Files
tubestation/toolkit/components/url-classifier/SBTelemetryUtils.h
dimi 80b83c117c Bug 1311933 - P2. Add telemetry to measure if completion match type is the same for v2 and v4. r=francois
When full match is found in both v2 and v4, the threat types returned should also be the same.
If threat types are different, the telemetry record this by setting a bit flags which indicates
what threat types are being returned.

If threat types are the same, this telemetry will record 0.

MozReview-Commit-ID: Laz77yoCg00
2017-04-12 09:11:18 +08:00

58 lines
1.7 KiB
C++

//* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SBTelemetryUtils_h__
#define SBTelemetryUtils_h__
#include "mozilla/TypedEnumBits.h"
namespace mozilla {
namespace safebrowsing {
enum class MatchResult : uint8_t
{
eNoMatch = 0x00,
eV2Prefix = 0x01,
eV4Prefix = 0x02,
eV2Completion = 0x04,
eV4Completion = 0x08,
eTelemetryDisabled = 0x10,
eBothPrefix = eV2Prefix | eV4Prefix,
eBothCompletion = eV2Completion | eV4Completion,
eV2PreAndCom = eV2Prefix | eV2Completion,
eV4PreAndCom = eV4Prefix | eV4Completion,
eBothPreAndV2Com = eBothPrefix | eV2Completion,
eBothPreAndV4Com = eBothPrefix | eV4Completion,
eAll = eBothPrefix | eBothCompletion,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(MatchResult)
enum class MatchThreatType : uint8_t
{
eIdentical = 0x00,
eV2Phishing = 0x01,
eV2Malware = 0x02,
eV2Unwanted = 0x04,
eV4Phishing = 0x08,
eV4Malware = 0x10,
eV4Unwanted = 0x20,
ePhishingMask = eV2Phishing | eV4Phishing,
eMalwareMask = eV2Malware | eV4Malware,
eUnwantedMask = eV2Unwanted | eV4Unwanted,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(MatchThreatType)
uint8_t
MatchResultToUint(const MatchResult& aResult);
MatchThreatType
TableNameToThreatType(bool aIsV2, const nsACString& aTable);
} // namespace safebrowsing
} // namespace mozilla
#endif //SBTelemetryUtils_h__