OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socket/nss_ssl_util.h" | 5 #include "net/socket/nss_ssl_util.h" |
6 | 6 |
7 #include <nss.h> | 7 #include <nss.h> |
8 #include <secerr.h> | 8 #include <secerr.h> |
9 #include <ssl.h> | 9 #include <ssl.h> |
10 #include <sslerr.h> | 10 #include <sslerr.h> |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 virtual Value* ToValue() const { | 243 virtual Value* ToValue() const { |
244 DictionaryValue* dict = new DictionaryValue(); | 244 DictionaryValue* dict = new DictionaryValue(); |
245 dict->SetString("function", function_); | 245 dict->SetString("function", function_); |
246 if (!param_.empty()) | 246 if (!param_.empty()) |
247 dict->SetString("param", param_); | 247 dict->SetString("param", param_); |
248 dict->SetInteger("ssl_lib_error", ssl_lib_error_); | 248 dict->SetInteger("ssl_lib_error", ssl_lib_error_); |
249 return dict; | 249 return dict; |
250 } | 250 } |
251 | 251 |
| 252 protected: |
| 253 virtual ~SSLFailedNSSFunctionParams() {} |
| 254 |
252 private: | 255 private: |
253 const std::string function_; | 256 const std::string function_; |
254 const std::string param_; | 257 const std::string param_; |
255 const PRErrorCode ssl_lib_error_; | 258 const PRErrorCode ssl_lib_error_; |
256 }; | 259 }; |
257 | 260 |
258 void LogFailedNSSFunction(const BoundNetLog& net_log, | 261 void LogFailedNSSFunction(const BoundNetLog& net_log, |
259 const char* function, | 262 const char* function, |
260 const char* param) { | 263 const char* param) { |
261 net_log.AddEvent( | 264 net_log.AddEvent( |
262 NetLog::TYPE_SSL_NSS_ERROR, | 265 NetLog::TYPE_SSL_NSS_ERROR, |
263 make_scoped_refptr(new SSLFailedNSSFunctionParams(function, param))); | 266 make_scoped_refptr(new SSLFailedNSSFunctionParams(function, param))); |
264 } | 267 } |
265 | 268 |
266 } // namespace net | 269 } // namespace net |
OLD | NEW |