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

Unified Diff: net/cert/multi_threaded_cert_verifier.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/cert/multi_log_ct_verifier.cc ('k') | net/cert/x509_certificate_net_log_param.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/multi_threaded_cert_verifier.cc
diff --git a/net/cert/multi_threaded_cert_verifier.cc b/net/cert/multi_threaded_cert_verifier.cc
index 1bfb373b4698bea9c31ecdf9309c55cfa059390d..b7ad60fac3af27f30acadc39d86b393c2c010771 100644
--- a/net/cert/multi_threaded_cert_verifier.cc
+++ b/net/cert/multi_threaded_cert_verifier.cc
@@ -81,9 +81,10 @@ const unsigned kMaxCacheEntries = 256;
// The number of seconds to cache entries.
const unsigned kTTLSecs = 1800; // 30 minutes.
-base::Value* CertVerifyResultCallback(const CertVerifyResult& verify_result,
- NetLogCaptureMode capture_mode) {
- base::DictionaryValue* results = new base::DictionaryValue();
+scoped_ptr<base::Value> CertVerifyResultCallback(
+ const CertVerifyResult& verify_result,
+ NetLogCaptureMode capture_mode) {
+ scoped_ptr<base::DictionaryValue> results(new base::DictionaryValue());
results->SetBoolean("has_md5", verify_result.has_md5);
results->SetBoolean("has_md2", verify_result.has_md2);
results->SetBoolean("has_md4", verify_result.has_md4);
@@ -98,16 +99,16 @@ base::Value* CertVerifyResultCallback(const CertVerifyResult& verify_result,
NetLogX509CertificateCallback(verify_result.verified_cert.get(),
capture_mode));
- base::ListValue* hashes = new base::ListValue();
+ scoped_ptr<base::ListValue> hashes(new base::ListValue());
for (std::vector<HashValue>::const_iterator it =
verify_result.public_key_hashes.begin();
it != verify_result.public_key_hashes.end();
++it) {
hashes->AppendString(it->ToString());
}
- results->Set("public_key_hashes", hashes);
+ results->Set("public_key_hashes", hashes.Pass());
- return results;
+ return results.Pass();
}
} // namespace
@@ -262,7 +263,7 @@ class CertVerifierJob {
weak_ptr_factory_(this) {
net_log_.BeginEvent(
NetLog::TYPE_CERT_VERIFIER_JOB,
- base::Bind(&NetLogX509CertificateCallback, base::Unretained(cert)));
+ base::Bind(NetLogX509CertificateCallback, base::Unretained(cert)));
}
// Indicates whether this was the first job started by the CertVerifier. This
@@ -339,7 +340,7 @@ class CertVerifierJob {
const MultiThreadedCertVerifier::CachedResult& verify_result) {
net_log_.EndEvent(
NetLog::TYPE_CERT_VERIFIER_JOB,
- base::Bind(&CertVerifyResultCallback, verify_result.result));
+ base::Bind(CertVerifyResultCallback, verify_result.result));
base::TimeDelta latency = base::TimeTicks::Now() - start_time_;
UMA_HISTOGRAM_CUSTOM_TIMES("Net.CertVerifier_Job_Latency",
latency,
« no previous file with comments | « net/cert/multi_log_ct_verifier.cc ('k') | net/cert/x509_certificate_net_log_param.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698