OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "net/base/net_log_logger.h" | 5 #include "net/base/net_log_logger.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 base::DictionaryValue* dict = new base::DictionaryValue(); | 120 base::DictionaryValue* dict = new base::DictionaryValue(); |
121 | 121 |
122 #define NET_ERROR(label, value) \ | 122 #define NET_ERROR(label, value) \ |
123 dict->SetInteger(# label, static_cast<int>(value)); | 123 dict->SetInteger(# label, static_cast<int>(value)); |
124 #include "net/base/net_error_list.h" | 124 #include "net/base/net_error_list.h" |
125 #undef NET_ERROR | 125 #undef NET_ERROR |
126 | 126 |
127 constants_dict->Set("netError", dict); | 127 constants_dict->Set("netError", dict); |
128 } | 128 } |
129 | 129 |
| 130 // Add information on the relationship between SDCH problem codes and their |
| 131 // symbolic names. |
| 132 { |
| 133 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 134 |
| 135 #define SDCH_PROBLEM_CODE(label, value) \ |
| 136 dict->SetInteger(#label, static_cast<int>(value)); |
| 137 #include "net/base/sdch_problem_code_list.h" |
| 138 #undef SDCH_PROBLEM_CODE |
| 139 |
| 140 constants_dict->Set("sdchProblemCode", dict); |
| 141 } |
| 142 |
130 // Add information on the relationship between QUIC error codes and their | 143 // Add information on the relationship between QUIC error codes and their |
131 // symbolic names. | 144 // symbolic names. |
132 { | 145 { |
133 base::DictionaryValue* dict = new base::DictionaryValue(); | 146 base::DictionaryValue* dict = new base::DictionaryValue(); |
134 | 147 |
135 for (net::QuicErrorCode error = net::QUIC_NO_ERROR; | 148 for (net::QuicErrorCode error = net::QUIC_NO_ERROR; |
136 error < net::QUIC_LAST_ERROR; | 149 error < net::QUIC_LAST_ERROR; |
137 error = static_cast<net::QuicErrorCode>(error + 1)) { | 150 error = static_cast<net::QuicErrorCode>(error + 1)) { |
138 dict->SetInteger(net::QuicUtils::ErrorToString(error), | 151 dict->SetInteger(net::QuicUtils::ErrorToString(error), |
139 static_cast<int>(error)); | 152 static_cast<int>(error)); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 239 } |
227 | 240 |
228 // "clientInfo" key is required for some NetLogLogger log readers. | 241 // "clientInfo" key is required for some NetLogLogger log readers. |
229 // Provide a default empty value for compatibility. | 242 // Provide a default empty value for compatibility. |
230 constants_dict->Set("clientInfo", new base::DictionaryValue()); | 243 constants_dict->Set("clientInfo", new base::DictionaryValue()); |
231 | 244 |
232 return constants_dict; | 245 return constants_dict; |
233 } | 246 } |
234 | 247 |
235 } // namespace net | 248 } // namespace net |
OLD | NEW |