| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 219       } | 219       } | 
| 220       LOG(WARNING) << "Unknown error " << err << " mapped to net::ERR_FAILED"; | 220       LOG(WARNING) << "Unknown error " << err << " mapped to net::ERR_FAILED"; | 
| 221       return ERR_FAILED; | 221       return ERR_FAILED; | 
| 222     } | 222     } | 
| 223   } | 223   } | 
| 224 } | 224 } | 
| 225 | 225 | 
| 226 // Returns parameters to attach to the NetLog when we receive an error in | 226 // Returns parameters to attach to the NetLog when we receive an error in | 
| 227 // response to a call to an NSS function.  Used instead of | 227 // response to a call to an NSS function.  Used instead of | 
| 228 // NetLogSSLErrorCallback with events of type TYPE_SSL_NSS_ERROR. | 228 // NetLogSSLErrorCallback with events of type TYPE_SSL_NSS_ERROR. | 
| 229 Value* NetLogSSLFailedNSSFunctionCallback( | 229 base::Value* NetLogSSLFailedNSSFunctionCallback( | 
| 230     const char* function, | 230     const char* function, | 
| 231     const char* param, | 231     const char* param, | 
| 232     int ssl_lib_error, | 232     int ssl_lib_error, | 
| 233     NetLog::LogLevel /* log_level */) { | 233     NetLog::LogLevel /* log_level */) { | 
| 234   DictionaryValue* dict = new DictionaryValue(); | 234   base::DictionaryValue* dict = new base::DictionaryValue(); | 
| 235   dict->SetString("function", function); | 235   dict->SetString("function", function); | 
| 236   if (param[0] != '\0') | 236   if (param[0] != '\0') | 
| 237     dict->SetString("param", param); | 237     dict->SetString("param", param); | 
| 238   dict->SetInteger("ssl_lib_error", ssl_lib_error); | 238   dict->SetInteger("ssl_lib_error", ssl_lib_error); | 
| 239   return dict; | 239   return dict; | 
| 240 } | 240 } | 
| 241 | 241 | 
| 242 void LogFailedNSSFunction(const BoundNetLog& net_log, | 242 void LogFailedNSSFunction(const BoundNetLog& net_log, | 
| 243                           const char* function, | 243                           const char* function, | 
| 244                           const char* param) { | 244                           const char* param) { | 
| 245   DCHECK(function); | 245   DCHECK(function); | 
| 246   DCHECK(param); | 246   DCHECK(param); | 
| 247   net_log.AddEvent( | 247   net_log.AddEvent( | 
| 248       NetLog::TYPE_SSL_NSS_ERROR, | 248       NetLog::TYPE_SSL_NSS_ERROR, | 
| 249       base::Bind(&NetLogSSLFailedNSSFunctionCallback, | 249       base::Bind(&NetLogSSLFailedNSSFunctionCallback, | 
| 250                  function, param, PR_GetError())); | 250                  function, param, PR_GetError())); | 
| 251 } | 251 } | 
| 252 | 252 | 
| 253 }  // namespace net | 253 }  // namespace net | 
| OLD | NEW | 
|---|