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

Unified Diff: components/certificate_transparency/log_dns_client.h

Issue 2380293002: Adds LogDnsClient::NotifyWhenNotThrottled (Closed)
Patch Set: Addresses Ryan's comment Created 4 years, 2 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 | « no previous file | components/certificate_transparency/log_dns_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2786307d64441de29c431eb3f65097ce49f06757..ded22255d2dce5fb5454efa03545ed6946cb4935 100644
--- a/components/certificate_transparency/log_dns_client.h
+++ b/components/certificate_transparency/log_dns_client.h
@@ -53,10 +53,17 @@ class LogDnsClient : public net::NetworkChangeNotifier::DNSObserver {
// Called by NetworkChangeNotifier when the DNS config is first read.
// The DnsClient's config will be updated in response.
void OnInitialDNSConfigRead() override;
+ // Registers a callback to be invoked when the number of concurrent queries
+ // falls below the limit defined by |max_concurrent_queries| (passed to the
+ // constructor of LogDnsClient). This callback will fire once and then be
+ // unregistered. Should only be used if QueryAuditProof() returns
+ // net::ERR_TEMPORARILY_THROTTLED.
+ void NotifyWhenNotThrottled(const base::Closure& callback);
+
// Queries a CT log to retrieve an audit proof for the leaf with |leaf_hash|.
// The log is identified by |domain_for_log|, which is the DNS name used as a
// suffix for all queries.
// The |leaf_hash| is the SHA-256 Merkle leaf hash (see RFC6962, section 2.1).
// The size of the CT log tree, for which the proof is requested, must be
@@ -110,10 +117,12 @@ class LogDnsClient : public net::NetworkChangeNotifier::DNSObserver {
// the end and lookups will typically yield entries at the beginning,
// std::list is an efficient choice.
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_;
+ // Callbacks to invoke when the number of concurrent queries is at its limit.
+ std::list<base::Closure> not_throttled_callbacks_;
// Creates weak_ptrs to this, for callback purposes.
base::WeakPtrFactory<LogDnsClient> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(LogDnsClient);
};
« no previous file with comments | « no previous file | components/certificate_transparency/log_dns_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698