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

Side by Side Diff: net/cert/internal/cert_errors.cc

Issue 2326923002: Introduce CertErrors::ToDebugString(). (Closed)
Patch Set: checkpoint Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/cert/internal/cert_errors.h ('k') | net/cert/internal/verify_certificate_chain_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/cert/internal/cert_errors.h" 5 #include "net/cert/internal/cert_errors.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void CertErrors::AddWith1DerParam(CertErrorType type, const der::Input& der1) { 47 void CertErrors::AddWith1DerParam(CertErrorType type, const der::Input& der1) {
48 AddWithParam(type, base::MakeUnique<CertErrorParamsDer1>(der1)); 48 AddWithParam(type, base::MakeUnique<CertErrorParamsDer1>(der1));
49 } 49 }
50 50
51 void CertErrors::AddWith2DerParams(CertErrorType type, 51 void CertErrors::AddWith2DerParams(CertErrorType type,
52 const der::Input& der1, 52 const der::Input& der1,
53 const der::Input& der2) { 53 const der::Input& der2) {
54 AddWithParam(type, base::MakeUnique<CertErrorParamsDer2>(der1, der2)); 54 AddWithParam(type, base::MakeUnique<CertErrorParamsDer2>(der1, der2));
55 } 55 }
56 56
57 std::string CertErrors::ToDebugString() const {
58 std::string str;
59 for (const auto& error : errors_) {
60 if (!str.empty())
61 str += "\n";
62 str += error.type;
63 }
64 return str;
65 }
66
57 ScopedCertErrorsCertContext::ScopedCertErrorsCertContext( 67 ScopedCertErrorsCertContext::ScopedCertErrorsCertContext(
58 CertErrors* parent, 68 CertErrors* parent,
59 const ParsedCertificate* cert, 69 const ParsedCertificate* cert,
60 size_t i) { 70 size_t i) {
61 // TODO(crbug.com/634443): Implement. 71 // TODO(crbug.com/634443): Implement.
62 } 72 }
63 73
64 ScopedCertErrorsCertContext::~ScopedCertErrorsCertContext() { 74 ScopedCertErrorsCertContext::~ScopedCertErrorsCertContext() {
65 // TODO(crbug.com/634443): Implement. 75 // TODO(crbug.com/634443): Implement.
66 } 76 }
(...skipping 22 matching lines...) Expand all
89 : der1_(der1.AsString()), der2_(der2.AsString()) {} 99 : der1_(der1.AsString()), der2_(der2.AsString()) {}
90 100
91 std::unique_ptr<base::Value> CertErrorParamsDer2::ToValue() const { 101 std::unique_ptr<base::Value> CertErrorParamsDer2::ToValue() const {
92 auto dict = base::MakeUnique<base::DictionaryValue>(); 102 auto dict = base::MakeUnique<base::DictionaryValue>();
93 dict->SetString("der1", HexEncodeString(der1_)); 103 dict->SetString("der1", HexEncodeString(der1_));
94 dict->SetString("der2", HexEncodeString(der2_)); 104 dict->SetString("der2", HexEncodeString(der2_));
95 return std::move(dict); 105 return std::move(dict);
96 } 106 }
97 107
98 } // namespace net 108 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/cert_errors.h ('k') | net/cert/internal/verify_certificate_chain_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698