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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // Add a dictionary with information on the relationship between event type | 111 // Add a dictionary with information on the relationship between event type |
112 // enums and their symbolic names. | 112 // enums and their symbolic names. |
113 constants_dict->Set("logEventTypes", net::NetLog::GetEventTypesAsValue()); | 113 constants_dict->Set("logEventTypes", net::NetLog::GetEventTypesAsValue()); |
114 | 114 |
115 // Add a dictionary with information about the relationship between CertStatus | 115 // Add a dictionary with information about the relationship between CertStatus |
116 // flags and their symbolic names. | 116 // flags and their symbolic names. |
117 { | 117 { |
118 base::DictionaryValue* dict = new base::DictionaryValue(); | 118 base::DictionaryValue* dict = new base::DictionaryValue(); |
119 | 119 |
120 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCertStatusFlags); i++) | 120 for (size_t i = 0; i < arraysize(kCertStatusFlags); i++) |
121 dict->SetInteger(kCertStatusFlags[i].name, kCertStatusFlags[i].constant); | 121 dict->SetInteger(kCertStatusFlags[i].name, kCertStatusFlags[i].constant); |
122 | 122 |
123 constants_dict->Set("certStatusFlag", dict); | 123 constants_dict->Set("certStatusFlag", dict); |
124 } | 124 } |
125 | 125 |
126 // Add a dictionary with information about the relationship between load flag | 126 // Add a dictionary with information about the relationship between load flag |
127 // enums and their symbolic names. | 127 // enums and their symbolic names. |
128 { | 128 { |
129 base::DictionaryValue* dict = new base::DictionaryValue(); | 129 base::DictionaryValue* dict = new base::DictionaryValue(); |
130 | 130 |
131 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kLoadFlags); i++) | 131 for (size_t i = 0; i < arraysize(kLoadFlags); i++) |
132 dict->SetInteger(kLoadFlags[i].name, kLoadFlags[i].constant); | 132 dict->SetInteger(kLoadFlags[i].name, kLoadFlags[i].constant); |
133 | 133 |
134 constants_dict->Set("loadFlag", dict); | 134 constants_dict->Set("loadFlag", dict); |
135 } | 135 } |
136 | 136 |
137 // Add a dictionary with information about the relationship between load state | 137 // Add a dictionary with information about the relationship between load state |
138 // enums and their symbolic names. | 138 // enums and their symbolic names. |
139 { | 139 { |
140 base::DictionaryValue* dict = new base::DictionaryValue(); | 140 base::DictionaryValue* dict = new base::DictionaryValue(); |
141 | 141 |
142 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kLoadStateTable); i++) | 142 for (size_t i = 0; i < arraysize(kLoadStateTable); i++) |
143 dict->SetInteger(kLoadStateTable[i].name, kLoadStateTable[i].constant); | 143 dict->SetInteger(kLoadStateTable[i].name, kLoadStateTable[i].constant); |
144 | 144 |
145 constants_dict->Set("loadState", dict); | 145 constants_dict->Set("loadState", dict); |
146 } | 146 } |
147 | 147 |
148 // Add information on the relationship between net error codes and their | 148 // Add information on the relationship between net error codes and their |
149 // symbolic names. | 149 // symbolic names. |
150 { | 150 { |
151 base::DictionaryValue* dict = new base::DictionaryValue(); | 151 base::DictionaryValue* dict = new base::DictionaryValue(); |
152 | 152 |
153 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNetErrors); i++) | 153 for (size_t i = 0; i < arraysize(kNetErrors); i++) |
154 dict->SetInteger(ErrorToShortString(kNetErrors[i]), kNetErrors[i]); | 154 dict->SetInteger(ErrorToShortString(kNetErrors[i]), kNetErrors[i]); |
155 | 155 |
156 constants_dict->Set("netError", dict); | 156 constants_dict->Set("netError", dict); |
157 } | 157 } |
158 | 158 |
159 // Add information on the relationship between QUIC error codes and their | 159 // Add information on the relationship between QUIC error codes and their |
160 // symbolic names. | 160 // symbolic names. |
161 { | 161 { |
162 base::DictionaryValue* dict = new base::DictionaryValue(); | 162 base::DictionaryValue* dict = new base::DictionaryValue(); |
163 | 163 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 | 256 |
257 // "clientInfo" key is required for some NetLogLogger log readers. | 257 // "clientInfo" key is required for some NetLogLogger log readers. |
258 // Provide a default empty value for compatibility. | 258 // Provide a default empty value for compatibility. |
259 constants_dict->Set("clientInfo", new base::DictionaryValue()); | 259 constants_dict->Set("clientInfo", new base::DictionaryValue()); |
260 | 260 |
261 return constants_dict; | 261 return constants_dict; |
262 } | 262 } |
263 | 263 |
264 } // namespace net | 264 } // namespace net |
OLD | NEW |