| Index: net/cert/ct_serialization.cc
|
| diff --git a/net/cert/ct_serialization.cc b/net/cert/ct_serialization.cc
|
| index 691b18d96cb1b08be2fb8bf3abb87035a3c73353..c139ec9e56713a3f927083d74a5617218f41f263 100644
|
| --- a/net/cert/ct_serialization.cc
|
| +++ b/net/cert/ct_serialization.cc
|
| @@ -317,8 +317,9 @@ bool DecodeSCTList(base::StringPiece* input,
|
| }
|
|
|
| bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
|
| - SignedCertificateTimestamp* output) {
|
| - SignedCertificateTimestamp result;
|
| + scoped_refptr<SignedCertificateTimestamp>* output) {
|
| + scoped_refptr<SignedCertificateTimestamp> result(
|
| + new SignedCertificateTimestamp());
|
| unsigned version;
|
| if (!ReadUint(kVersionLength, input, &version))
|
| return false;
|
| @@ -327,7 +328,7 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
|
| return false;
|
| }
|
|
|
| - result.version = SignedCertificateTimestamp::SCT_VERSION_1;
|
| + result->version = SignedCertificateTimestamp::SCT_VERSION_1;
|
| uint64 timestamp;
|
| base::StringPiece log_id;
|
| base::StringPiece extensions;
|
| @@ -335,7 +336,7 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
|
| !ReadUint(kTimestampLength, input, ×tamp) ||
|
| !ReadVariableBytes(kExtensionsLengthBytes, input,
|
| &extensions) ||
|
| - !DecodeDigitallySigned(input, &result.signature)) {
|
| + !DecodeDigitallySigned(input, &result->signature)) {
|
| return false;
|
| }
|
|
|
| @@ -344,13 +345,13 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
|
| return false;
|
| }
|
|
|
| - log_id.CopyToString(&result.log_id);
|
| - extensions.CopyToString(&result.extensions);
|
| - result.timestamp =
|
| + log_id.CopyToString(&result->log_id);
|
| + extensions.CopyToString(&result->extensions);
|
| + result->timestamp =
|
| base::Time::UnixEpoch() +
|
| base::TimeDelta::FromMilliseconds(static_cast<int64>(timestamp));
|
|
|
| - *output = result;
|
| + output->swap(result);
|
| return true;
|
| }
|
|
|
|
|