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

Unified Diff: net/cert/internal/cert_errors.cc

Issue 2755483008: Add initial CertVerifyProcBuiltin. (Closed)
Patch Set: type notimplemented properly Created 3 years, 9 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/internal/cert_errors.h ('k') | net/cert/internal/path_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/cert_errors.cc
diff --git a/net/cert/internal/cert_errors.cc b/net/cert/internal/cert_errors.cc
index e66ab827fcf6b45c9ef13ac4accebae92b3bba80..d58b575f96a7dbd7ae899aba84409e1f875f638f 100644
--- a/net/cert/internal/cert_errors.cc
+++ b/net/cert/internal/cert_errors.cc
@@ -72,6 +72,18 @@ void AppendNodeToDebugString(CertErrorNode* node,
AppendChildrenToDebugString(node->children, cur_indentation, out);
}
+// Returns true if |children| contains the error |id| anywhere within it or its
+// children recursively.
+bool NodesContainError(const CertErrorNodes& children, CertErrorId id) {
+ for (const auto& child : children) {
+ if (child->node_type == CertErrorNodeType::TYPE_ERROR && child->id == id)
+ return true;
+ if (NodesContainError(child->children, id))
+ return true;
+ }
+ return false;
+}
+
} // namespace
CertErrorNode::CertErrorNode(CertErrorNodeType node_type,
@@ -124,6 +136,10 @@ std::string CertErrors::ToDebugString() const {
return result;
}
+bool CertErrors::ContainsError(CertErrorId id) const {
+ return NodesContainError(nodes_, id);
+}
+
void CertErrors::AddNode(std::unique_ptr<CertErrorNode> node) {
if (current_scoper_)
current_scoper_->LazyGetRootNode()->AddChild(std::move(node));
« no previous file with comments | « net/cert/internal/cert_errors.h ('k') | net/cert/internal/path_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698