Chromium Code Reviews| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // symbolic names. | 147 // symbolic names. |
| 148 { | 148 { |
| 149 base::DictionaryValue* dict = new base::DictionaryValue(); | 149 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 150 | 150 |
| 151 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNetErrors); i++) | 151 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNetErrors); i++) |
| 152 dict->SetInteger(ErrorToShortString(kNetErrors[i]), kNetErrors[i]); | 152 dict->SetInteger(ErrorToShortString(kNetErrors[i]), kNetErrors[i]); |
| 153 | 153 |
| 154 constants_dict->Set("netError", dict); | 154 constants_dict->Set("netError", dict); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Add information on the relationship between SDCH problem codes and their | |
| 158 // symbolic names. | |
| 159 { | |
| 160 base::DictionaryValue* dict = new base::DictionaryValue(); | |
| 161 | |
| 162 #define SDCH_PROBLEM_CODE(label, value) \ | |
| 163 dict->SetInteger(#label, static_cast<int>(value)); | |
|
mmenke
2014/10/03 18:59:27
nit: +2 indent.
baranovich
2014/10/27 20:49:24
Done.
| |
| 164 #include "net/base/sdch_problem_code_list.h" | |
| 165 #undef SDCH_PROBLEM_CODE | |
|
mmenke
2014/10/03 18:59:27
The code in this file has been refactored to reduc
baranovich
2014/10/27 20:49:24
Done.
| |
| 166 | |
| 167 constants_dict->Set("sdchProblemCode", dict); | |
| 168 } | |
| 169 | |
| 157 // Add information on the relationship between QUIC error codes and their | 170 // Add information on the relationship between QUIC error codes and their |
| 158 // symbolic names. | 171 // symbolic names. |
| 159 { | 172 { |
| 160 base::DictionaryValue* dict = new base::DictionaryValue(); | 173 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 161 | 174 |
| 162 for (net::QuicErrorCode error = net::QUIC_NO_ERROR; | 175 for (net::QuicErrorCode error = net::QUIC_NO_ERROR; |
| 163 error < net::QUIC_LAST_ERROR; | 176 error < net::QUIC_LAST_ERROR; |
| 164 error = static_cast<net::QuicErrorCode>(error + 1)) { | 177 error = static_cast<net::QuicErrorCode>(error + 1)) { |
| 165 dict->SetInteger(net::QuicUtils::ErrorToString(error), | 178 dict->SetInteger(net::QuicUtils::ErrorToString(error), |
| 166 static_cast<int>(error)); | 179 static_cast<int>(error)); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 } | 266 } |
| 254 | 267 |
| 255 // "clientInfo" key is required for some NetLogLogger log readers. | 268 // "clientInfo" key is required for some NetLogLogger log readers. |
| 256 // Provide a default empty value for compatibility. | 269 // Provide a default empty value for compatibility. |
| 257 constants_dict->Set("clientInfo", new base::DictionaryValue()); | 270 constants_dict->Set("clientInfo", new base::DictionaryValue()); |
| 258 | 271 |
| 259 return constants_dict; | 272 return constants_dict; |
| 260 } | 273 } |
| 261 | 274 |
| 262 } // namespace net | 275 } // namespace net |
| OLD | NEW |