Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ | |
| 6 #define REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ | |
| 7 | |
| 8 #include "net/url_request/url_fetcher_delegate.h" | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 | |
| 12 namespace remoting { | |
| 13 | |
| 14 class ChromotingHostContext; | |
| 15 | |
| 16 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
| |
| 17 public: | |
| 18 DnsBlackholeChecker(ChromotingHostContext* context, | |
| 19 std::string talkgadget_prefix); | |
| 20 virtual ~DnsBlackholeChecker(); | |
| 21 | |
| 22 // net::URLFetcherDelegate interface. | |
| 23 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | |
| 24 | |
| 25 // Initiates a check the verify that the host talkgadget has not been "DNS | |
| 26 // blackholed" to prevent connections. | |
| 27 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.
| |
| 28 | |
| 29 private: | |
| 30 ChromotingHostContext* context_; | |
| 31 | |
| 32 // URL fetcher used to verify access to the host talkgadget. | |
| 33 scoped_ptr<net::URLFetcher> url_fetcher_; | |
| 34 | |
| 35 // The string pre-pended to '.talkgadget.google.com' to create the full | |
| 36 // talkgadget domain name for the host. | |
| 37 std::string talkgadget_prefix_; | |
| 38 | |
| 39 // Called with the results of the connection check. | |
| 40 base::Callback<void(bool)> callback_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(DnsBlackholeChecker); | |
| 43 }; | |
| 44 | |
| 45 } // namespace remoting | |
| 46 | |
| 47 #endif // REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ | |
| OLD | NEW |