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

Unified Diff: components/certificate_transparency/log_dns_client.h

Issue 2369373002: LogDnsClient now returns some errors synchronously (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/certificate_transparency/log_dns_client.h
diff --git a/components/certificate_transparency/log_dns_client.h b/components/certificate_transparency/log_dns_client.h
index 0109ee28007678f24a0669448843a372a71825c7..47fd5d3855cc74b60db7ca0970258c421e50dfb1 100644
--- a/components/certificate_transparency/log_dns_client.h
+++ b/components/certificate_transparency/log_dns_client.h
@@ -6,22 +6,19 @@
#define COMPONENTS_CERTIFICATE_TRANSPARENCY_LOG_DNS_CLIENT_H_
#include <stdint.h>
#include <list>
-#include <string>
#include "base/callback.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/network_change_notifier.h"
#include "net/log/net_log.h"
namespace net {
class DnsClient;
-class DnsResponse;
-class DnsTransaction;
namespace ct {
struct MerkleAuditProof;
} // namespace ct
} // namespace net
@@ -69,14 +66,14 @@ class LogDnsClient : public net::NetworkChangeNotifier::DNSObserver {
// The |leaf_hash| is the SHA-256 Merkle leaf hash (see RFC6962, section 2.1).
// The size of the CT log tree must be provided in |tree_size|.
// The log is identified by |domain_for_log|, which is the DNS name used as a
// suffix for all queries.
// The |callback| is invoked when the query is complete, or an error occurs.
Eran Messeri 2016/09/28 13:44:08 Document the return value - that on successful sub
Rob Percival 2016/09/28 16:19:14 Done.
- void QueryAuditProof(const std::string& domain_for_log,
- base::StringPiece leaf_hash,
- uint64_t tree_size,
- const AuditProofCallback& callback);
+ int QueryAuditProof(base::StringPiece domain_for_log,
Eran Messeri 2016/09/28 13:44:08 Question to rsleevi: Why not use net::Error here?
+ base::StringPiece leaf_hash,
+ uint64_t tree_size,
+ const AuditProofCallback& callback);
private:
// An audit proof query that is in progress.
class AuditProofQuery;
@@ -100,10 +97,12 @@ class LogDnsClient : public net::NetworkChangeNotifier::DNSObserver {
// Used to perform DNS queries.
std::unique_ptr<net::DnsClient> dns_client_;
// Passed to the DNS client for logging.
net::BoundNetLog net_log_;
// Audit proof queries that haven't completed yet.
+ // Expected to typically be a FIFO queue of queries, so a std::list should be
+ // efficient.
Eran Messeri 2016/09/28 13:44:08 Be more explicit in the comment: // A FIFO queue o
Rob Percival 2016/09/28 16:19:14 Done.
std::list<std::unique_ptr<AuditProofQuery>> audit_proof_queries_;
// The maximum number of queries that can be in flight at one time.
size_t max_concurrent_queries_;
// Creates weak_ptrs to this, for callback purposes.
base::WeakPtrFactory<LogDnsClient> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698