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/cert/ct_signed_certificate_timestamp_log_param.h" | 5 #include "net/cert/ct_signed_certificate_timestamp_log_param.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 const ct::SCTList& sct_list) { | 118 const ct::SCTList& sct_list) { |
119 scoped_ptr<base::ListValue> output_scts(new base::ListValue()); | 119 scoped_ptr<base::ListValue> output_scts(new base::ListValue()); |
120 for (const auto& sct : sct_list) | 120 for (const auto& sct : sct_list) |
121 output_scts->Append(SCTToDictionary(*(sct.get()))); | 121 output_scts->Append(SCTToDictionary(*(sct.get()))); |
122 | 122 |
123 return output_scts; | 123 return output_scts; |
124 } | 124 } |
125 | 125 |
126 } // namespace | 126 } // namespace |
127 | 127 |
128 base::Value* NetLogSignedCertificateTimestampCallback( | 128 scoped_ptr<base::Value> NetLogSignedCertificateTimestampCallback( |
129 const ct::CTVerifyResult* ct_result, | 129 const ct::CTVerifyResult* ct_result, |
130 NetLogCaptureMode capture_mode) { | 130 NetLogCaptureMode capture_mode) { |
131 base::DictionaryValue* dict = new base::DictionaryValue(); | 131 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
132 | 132 |
133 dict->Set("verified_scts", | 133 dict->Set("verified_scts", |
134 SCTListToPrintableValues(ct_result->verified_scts)); | 134 SCTListToPrintableValues(ct_result->verified_scts)); |
135 | 135 |
136 dict->Set("invalid_scts", | 136 dict->Set("invalid_scts", |
137 SCTListToPrintableValues(ct_result->invalid_scts)); | 137 SCTListToPrintableValues(ct_result->invalid_scts)); |
138 | 138 |
139 dict->Set("unknown_logs_scts", | 139 dict->Set("unknown_logs_scts", |
140 SCTListToPrintableValues(ct_result->unknown_logs_scts)); | 140 SCTListToPrintableValues(ct_result->unknown_logs_scts)); |
141 | 141 |
142 return dict; | 142 return dict.Pass(); |
143 } | 143 } |
144 | 144 |
145 base::Value* NetLogRawSignedCertificateTimestampCallback( | 145 scoped_ptr<base::Value> NetLogRawSignedCertificateTimestampCallback( |
146 const std::string* embedded_scts, | 146 const std::string* embedded_scts, |
147 const std::string* sct_list_from_ocsp, | 147 const std::string* sct_list_from_ocsp, |
148 const std::string* sct_list_from_tls_extension, | 148 const std::string* sct_list_from_tls_extension, |
149 NetLogCaptureMode capture_mode) { | 149 NetLogCaptureMode capture_mode) { |
150 base::DictionaryValue* dict = new base::DictionaryValue(); | 150 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
151 | 151 |
152 SetBinaryData("embedded_scts", *embedded_scts, dict); | 152 SetBinaryData("embedded_scts", *embedded_scts, dict.release()); |
153 SetBinaryData("scts_from_ocsp_response", *sct_list_from_ocsp, dict); | 153 SetBinaryData("scts_from_ocsp_response", *sct_list_from_ocsp, dict.release()); |
154 SetBinaryData("scts_from_tls_extension", *sct_list_from_tls_extension, dict); | 154 SetBinaryData("scts_from_tls_extension", *sct_list_from_tls_extension, |
| 155 dict.release()); |
155 | 156 |
156 return dict; | 157 return dict.Pass(); |
157 } | 158 } |
158 | 159 |
159 } // namespace net | 160 } // namespace net |
OLD | NEW |