Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: components/error_page/common/net_error_info.h

Issue 1277213003: Move DNS functions from net_error_info.h into error_page namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/net/net_error_helper.cc ('k') | components/error_page/common/net_error_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_ 5 #ifndef COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
6 #define COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_ 6 #define COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
7 7
8 // TODO(hashimoto): Change this to namespace error_page. 8 // TODO(hashimoto): Change this to namespace error_page.
9 namespace chrome_common_net { 9 namespace chrome_common_net {
10 10
11 // Network error page events. Used for UMA statistics. 11 // Network error page events. Used for UMA statistics.
12 enum NetworkErrorPageEvent { 12 enum NetworkErrorPageEvent {
tfarina 2015/08/10 18:18:59 I'd like to do this in a follow up.
13 NETWORK_ERROR_PAGE_SHOWN = 0, // Error pages shown. 13 NETWORK_ERROR_PAGE_SHOWN = 0, // Error pages shown.
14 14
15 NETWORK_ERROR_PAGE_RELOAD_BUTTON_SHOWN = 1, // Reload buttons shown. 15 NETWORK_ERROR_PAGE_RELOAD_BUTTON_SHOWN = 1, // Reload buttons shown.
16 NETWORK_ERROR_PAGE_RELOAD_BUTTON_CLICKED = 2, // Reload button clicked. 16 NETWORK_ERROR_PAGE_RELOAD_BUTTON_CLICKED = 2, // Reload button clicked.
17 NETWORK_ERROR_PAGE_RELOAD_BUTTON_ERROR = 3, // Reload button clicked 17 NETWORK_ERROR_PAGE_RELOAD_BUTTON_ERROR = 3, // Reload button clicked
18 // -> error. 18 // -> error.
19 19
20 // Same for the "Show saved copy" button. 20 // Same for the "Show saved copy" button.
21 NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_SHOWN = 4, 21 NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_SHOWN = 4,
22 NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_CLICKED = 5, 22 NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_CLICKED = 5,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 // The DNS configuration is wrong, or the servers are down or broken. 77 // The DNS configuration is wrong, or the servers are down or broken.
78 DNS_PROBE_FINISHED_BAD_CONFIG, 78 DNS_PROBE_FINISHED_BAD_CONFIG,
79 79
80 // The DNS servers are working fine, so the domain must not exist. 80 // The DNS servers are working fine, so the domain must not exist.
81 DNS_PROBE_FINISHED_NXDOMAIN, 81 DNS_PROBE_FINISHED_NXDOMAIN,
82 82
83 DNS_PROBE_MAX 83 DNS_PROBE_MAX
84 }; 84 };
85 85
86 } // namespace chrome_common_net
87
88 namespace error_page {
89
86 // Returns a string representing |status|. It should be simply the name of 90 // Returns a string representing |status|. It should be simply the name of
87 // the value as a string, but don't rely on that. This is presented to the 91 // the value as a string, but don't rely on that. This is presented to the
88 // user as part of the DNS error page (as the error code, at the bottom), 92 // user as part of the DNS error page (as the error code, at the bottom),
89 // and is also used in some verbose log messages. 93 // and is also used in some verbose log messages.
90 // 94 //
91 // The function will NOTREACHED() and return an empty string if given an int 95 // The function will NOTREACHED() and return an empty string if given an int
92 // that does not match a value in DnsProbeStatus (or if it is DNS_PROBE_MAX, 96 // that does not match a value in DnsProbeStatus (or if it is DNS_PROBE_MAX,
93 // which is not a real status). 97 // which is not a real status).
94 const char* DnsProbeStatusToString(int status); 98 const char* DnsProbeStatusToString(int status);
95 99
96 // Returns true if |status| is one of the DNS_PROBE_FINISHED_* statuses. 100 // Returns true if |status| is one of the DNS_PROBE_FINISHED_* statuses.
97 bool DnsProbeStatusIsFinished(DnsProbeStatus status); 101 bool DnsProbeStatusIsFinished(chrome_common_net::DnsProbeStatus status);
98 102
99 // Record specific error page events. 103 // Record specific error page events.
100 void RecordEvent(NetworkErrorPageEvent event); 104 void RecordEvent(chrome_common_net::NetworkErrorPageEvent event);
101 105
102 // The error domain used to pass DNS probe statuses to the localized error 106 // The error domain used to pass DNS probe statuses to the localized error
103 // code. 107 // code.
104 extern const char kDnsProbeErrorDomain[]; 108 extern const char kDnsProbeErrorDomain[];
105 109
106 } // namespace chrome_common_net 110 } // namespace error_page
107 111
108 #endif // COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_ 112 #endif // COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
OLDNEW
« no previous file with comments | « chrome/renderer/net/net_error_helper.cc ('k') | components/error_page/common/net_error_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698