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

Side by Side Diff: remoting/host/dns_blackhole_checker.h

Issue 719983002: Reporting of policy errors via host-offline-reason: part 3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hor-nohoststatussender
Patch Set: Addressed most feedback from Wez. Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ 5 #ifndef REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
6 #define REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ 6 #define REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
7 7
8 #include "net/url_request/url_fetcher_delegate.h" 8 #include "net/url_request/url_fetcher_delegate.h"
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 11
12 namespace net { 12 namespace net {
13 class URLRequestContextGetter; 13 class URLRequestContextGetter;
14 } // namespace net 14 } // namespace net
15 15
16 namespace remoting { 16 namespace remoting {
17 17
18 // This is the default prefix that is prepended to the kTalkGadgetUrl to form 18 // This is the default prefix that is prepended to the kTalkGadgetUrl to form
19 // the complete talkgadget URL used by the host. Policy settings allow admins 19 // the complete talkgadget URL used by the host. Policy settings allow admins
20 // to change the prefix that is used. 20 // to change the prefix that is used.
21 extern const char kDefaultHostTalkGadgetPrefix[]; 21 extern const char kDefaultHostTalkGadgetPrefix[];
22 22
23 class DnsBlackholeChecker : public net::URLFetcherDelegate { 23 class DnsBlackholeChecker : public net::URLFetcherDelegate {
24 public: 24 public:
25 DnsBlackholeChecker( 25 DnsBlackholeChecker(const scoped_refptr<net::URLRequestContextGetter>&
26 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, 26 url_request_context_getter,
Wez 2015/01/08 01:49:50 What's the rationale for making this const scoped_
Łukasz Anforowicz 2015/01/08 23:50:31 When following your suggestion to pass network_tas
Wez 2015/01/09 02:55:45 Acknowledged.
27 std::string talkgadget_prefix); 27 std::string talkgadget_prefix);
Wez 2015/01/08 01:49:50 Where did this weird wrapping come from?
Łukasz Anforowicz 2015/01/08 23:50:31 git cl format The thing is that the 1st parameter
Wez 2015/01/09 02:55:45 Acknowledged.
28 ~DnsBlackholeChecker() override; 28 ~DnsBlackholeChecker() override;
29 29
30 // net::URLFetcherDelegate interface. 30 // net::URLFetcherDelegate interface.
31 void OnURLFetchComplete(const net::URLFetcher* source) override; 31 void OnURLFetchComplete(const net::URLFetcher* source) override;
32 32
33 // Initiates a check the verify that the host talkgadget has not been "DNS 33 // Initiates a check the verify that the host talkgadget has not been "DNS
34 // blackholed" to prevent connections. If this is called again before the 34 // blackholed" to prevent connections. If this is called again before the
35 // callback has been called, then the second call is ignored. 35 // callback has been called, then the second call is ignored.
36 void CheckForDnsBlackhole(const base::Callback<void(bool)>& callback); 36 void CheckForDnsBlackhole(const base::Callback<void(bool)>& callback);
37 37
(...skipping 10 matching lines...) Expand all
48 48
49 // Called with the results of the connection check. 49 // Called with the results of the connection check.
50 base::Callback<void(bool)> callback_; 50 base::Callback<void(bool)> callback_;
51 51
52 DISALLOW_COPY_AND_ASSIGN(DnsBlackholeChecker); 52 DISALLOW_COPY_AND_ASSIGN(DnsBlackholeChecker);
53 }; 53 };
54 54
55 } // namespace remoting 55 } // namespace remoting
56 56
57 #endif // REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_ 57 #endif // REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698