Adds a reset button to the zoom bubble on GTK.
[chromium-blink-merge.git] / net / base / net_errors.h
blob12344e77609e2760ecff6ed754fdb7fc8dababb3
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_BASE_NET_ERRORS_H__
6 #define NET_BASE_NET_ERRORS_H__
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
13 namespace net {
15 // Error domain of the net module's error codes.
16 NET_EXPORT extern const char kErrorDomain[];
18 // Error values are negative.
19 enum Error {
20 // No error.
21 OK = 0,
23 #define NET_ERROR(label, value) ERR_ ## label = value,
24 #include "net/base/net_error_list.h"
25 #undef NET_ERROR
27 // The value of the first certificate error code.
28 ERR_CERT_BEGIN = ERR_CERT_COMMON_NAME_INVALID,
31 // Returns a textual representation of the error code for logging purposes.
32 NET_EXPORT const char* ErrorToString(int error);
34 // Returns true if |error| is a certificate error code.
35 inline bool IsCertificateError(int error) {
36 // Certificate errors are negative integers from net::ERR_CERT_BEGIN
37 // (inclusive) to net::ERR_CERT_END (exclusive) in *decreasing* order.
38 return error <= ERR_CERT_BEGIN && error > ERR_CERT_END;
41 // Map system error code to Error.
42 NET_EXPORT Error MapSystemError(int os_error);
44 // Returns a list of all the possible net error codes (not counting OK). This
45 // is intended for use with UMA histograms that are reporting the result of
46 // an action that is represented as a net error code.
48 // Note that the error codes are all positive (since histograms expect positive
49 // sample values). Also note that a guard bucket is created after any valid
50 // error code that is not followed immediately by a valid error code.
51 std::vector<int> GetAllErrorCodesForUma();
53 } // namespace net
55 #endif // NET_BASE_NET_ERRORS_H__