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 #include "nsISupportsImpl.h"
11 
12 namespace mozilla {
13 namespace safebrowsing {
14 
15 // We might need to expand the bucket here if telemetry shows lots of errors
16 // are neither connection errors nor DNS errors.
17 uint8_t NetworkErrorToBucket(nsresult rv);
18 
19 // Map the HTTP response code to a Telemetry bucket
20 uint32_t HTTPStatusToBucket(uint32_t status);
21 
22 enum UpdateTimeout {
23   eNoTimeout = 0,
24   eResponseTimeout = 1,
25   eDownloadTimeout = 2,
26 };
27 
28 }  // namespace safebrowsing
29 }  // namespace mozilla
30 
31 #endif  // UrlClassifierTelemetryUtils_h__
32