Home | History | Annotate | Download | only in net
      1 // Copyright 2013 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.
      4 
      5 #include "base/logging.h"
      6 #include "chrome/common/net/net_error_info.h"
      7 
      8 namespace chrome_common_net {
      9 
     10 const char kDnsProbeErrorDomain[] = "dnsprobe";
     11 
     12 const char* DnsProbeStatusToString(int status) {
     13   switch (status) {
     14   case DNS_PROBE_POSSIBLE:
     15     return "DNS_PROBE_POSSIBLE";
     16   case DNS_PROBE_NOT_RUN:
     17     return "DNS_PROBE_NOT_RUN";
     18   case DNS_PROBE_STARTED:
     19     return "DNS_PROBE_STARTED";
     20   case DNS_PROBE_FINISHED_INCONCLUSIVE:
     21     return "DNS_PROBE_FINISHED_INCONCLUSIVE";
     22   case DNS_PROBE_FINISHED_NO_INTERNET:
     23     return "DNS_PROBE_FINISHED_NO_INTERNET";
     24   case DNS_PROBE_FINISHED_BAD_CONFIG:
     25     return "DNS_PROBE_FINISHED_BAD_CONFIG";
     26   case DNS_PROBE_FINISHED_NXDOMAIN:
     27     return "DNS_PROBE_FINISHED_NXDOMAIN";
     28   default:
     29     NOTREACHED();
     30     return "";
     31   }
     32 }
     33 
     34 bool DnsProbeStatusIsFinished(DnsProbeStatus status) {
     35   return status >= DNS_PROBE_FINISHED_INCONCLUSIVE &&
     36          status < DNS_PROBE_MAX;
     37 }
     38 
     39 }  // namespace chrome_common_net
     40