Chromium Code Reviews| Index: remoting/host/dns_blackhole_checker.h |
| diff --git a/remoting/host/dns_blackhole_checker.h b/remoting/host/dns_blackhole_checker.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3e0c0f73359fd7c9680054a5874add3cbc5dc509 |
| --- /dev/null |
| +++ b/remoting/host/dns_blackhole_checker.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ |
| +#define REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ |
| + |
| +#include "net/url_request/url_fetcher_delegate.h" |
| + |
| +#include "base/callback.h" |
| + |
| +namespace remoting { |
| + |
| +class ChromotingHostContext; |
| + |
| +class DnsBlackholeChecker : public net::URLFetcherDelegate { |
|
Sergey Ulanov
2012/08/30 18:05:01
I'm not fan for of this name for the same reason I
Wez
2012/08/30 20:43:38
Given that we have no better ideas for naming, and
|
| + public: |
| + DnsBlackholeChecker(ChromotingHostContext* context, |
| + std::string talkgadget_prefix); |
| + virtual ~DnsBlackholeChecker(); |
| + |
| + // net::URLFetcherDelegate interface. |
| + virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| + |
| + // Initiates a check the verify that the host talkgadget has not been "DNS |
| + // blackholed" to prevent connections. |
| + void CheckForDnsBlackhole(const base::Callback<void(bool)>& callback); |
|
Sergey Ulanov
2012/08/30 18:05:01
Please add comment saying that if this method is c
garykac
2012/08/31 18:28:23
Done.
|
| + |
| + private: |
| + ChromotingHostContext* context_; |
| + |
| + // URL fetcher used to verify access to the host talkgadget. |
| + scoped_ptr<net::URLFetcher> url_fetcher_; |
| + |
| + // The string pre-pended to '.talkgadget.google.com' to create the full |
| + // talkgadget domain name for the host. |
| + std::string talkgadget_prefix_; |
| + |
| + // Called with the results of the connection check. |
| + base::Callback<void(bool)> callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DnsBlackholeChecker); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ |