1 //* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 
6 #ifndef UrlClassifierTelemetryUtils_h__
7 #define UrlClassifierTelemetryUtils_h__
8 
9 #include "mozilla/TypedEnumBits.h"
10 
11 namespace mozilla {
12 namespace safebrowsing {
13 
14 // We might need to expand the bucket here if telemetry shows lots of errors
15 // are neither connection errors nor DNS errors.
16 uint8_t NetworkErrorToBucket(nsresult rv);
17 
18 // Map the HTTP response code to a Telemetry bucket
19 uint32_t HTTPStatusToBucket(uint32_t status);
20 
21 enum UpdateTimeout {
22   eNoTimeout = 0,
23   eResponseTimeout = 1,
24   eDownloadTimeout = 2,
25 };
26 
27 }  // namespace safebrowsing
28 }  // namespace mozilla
29 
30 #endif  // UrlClassifierTelemetryUtils_h__
31