Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: net/socket/nss_ssl_util.cc

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/sdch/sdch_owner.cc ('k') | net/socket/socket_net_log_params.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/nss_ssl_util.cc
diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
index e98193b55334742ab696526c9b81d8298927a38a..ed4e84cd861baebe378d72fb48a06167d3fccd4a 100644
--- a/net/socket/nss_ssl_util.cc
+++ b/net/socket/nss_ssl_util.cc
@@ -79,14 +79,15 @@ size_t CiphersCopy(const uint16* in, uint16* out) {
}
}
-base::Value* NetLogSSLErrorCallback(int net_error,
- int ssl_lib_error,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogSSLErrorCallback(
+ int net_error,
+ int ssl_lib_error,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("net_error", net_error);
if (ssl_lib_error)
dict->SetInteger("ssl_lib_error", ssl_lib_error);
- return dict;
+ return dict.Pass();
}
class NSSSSLInitSingleton {
@@ -381,17 +382,17 @@ int MapNSSError(PRErrorCode err) {
// Returns parameters to attach to the NetLog when we receive an error in
// response to a call to an NSS function. Used instead of
// NetLogSSLErrorCallback with events of type TYPE_SSL_NSS_ERROR.
-base::Value* NetLogSSLFailedNSSFunctionCallback(
+scoped_ptr<base::Value> NetLogSSLFailedNSSFunctionCallback(
const char* function,
const char* param,
int ssl_lib_error,
NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("function", function);
if (param[0] != '\0')
dict->SetString("param", param);
dict->SetInteger("ssl_lib_error", ssl_lib_error);
- return dict;
+ return dict.Pass();
}
void LogFailedNSSFunction(const BoundNetLog& net_log,
@@ -399,15 +400,14 @@ void LogFailedNSSFunction(const BoundNetLog& net_log,
const char* param) {
DCHECK(function);
DCHECK(param);
- net_log.AddEvent(
- NetLog::TYPE_SSL_NSS_ERROR,
- base::Bind(&NetLogSSLFailedNSSFunctionCallback,
- function, param, PR_GetError()));
+ net_log.AddEvent(NetLog::TYPE_SSL_NSS_ERROR,
+ base::Bind(NetLogSSLFailedNSSFunctionCallback, function,
+ param, PR_GetError()));
}
NetLog::ParametersCallback CreateNetLogSSLErrorCallback(int net_error,
int ssl_lib_error) {
- return base::Bind(&NetLogSSLErrorCallback, net_error, ssl_lib_error);
+ return base::Bind(NetLogSSLErrorCallback, net_error, ssl_lib_error);
}
} // namespace net
« no previous file with comments | « net/sdch/sdch_owner.cc ('k') | net/socket/socket_net_log_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698