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_CONNECTION_BLOCK_CHECKER_H_ | |
| 6 #define REMOTING_HOST_CONNECTION_BLOCK_CHECKER_H_ | |
| 7 | |
| 8 #include "net/url_request/url_fetcher_delegate.h" | |
| 9 | |
| 10 namespace remoting { | |
| 11 | |
| 12 class ChromotingHostContext; | |
| 13 | |
| 14 class ConnectionBlockChecker : public net::URLFetcherDelegate { | |
| 15 public: | |
| 16 enum Status { | |
| 17 UNKNOWN, | |
| 18 ALLOW, | |
| 19 DENY, | |
|
Sergey Ulanov
2012/08/28 00:33:42
UNKNOWN/DENY distinction is not reliable, so I thi
garykac
2012/08/29 00:07:15
Removed.
| |
| 20 }; | |
| 21 | |
| 22 ConnectionBlockChecker(ChromotingHostContext* context, | |
| 23 std::string talkgadget_prefix); | |
| 24 virtual ~ConnectionBlockChecker() {} | |
|
Sergey Ulanov
2012/08/28 00:33:42
move destructor implementation to the .cc file. cl
garykac
2012/08/29 00:07:15
Done.
| |
| 25 | |
| 26 Status GetStatus(); | |
| 27 | |
| 28 private: | |
| 29 // net::URLFetcherDelegate interface. | |
| 30 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | |
| 31 | |
| 32 ChromotingHostContext* context_; | |
| 33 | |
| 34 // URL fetcher used to verify access to the host talkgadget. | |
| 35 scoped_ptr<net::URLFetcher> url_fetcher_; | |
| 36 | |
| 37 // The string pre-pended to '.talkgadget.google.com' to create the full | |
| 38 // talkgadget domain name for the host. | |
| 39 std::string talkgadget_prefix_; | |
| 40 | |
| 41 // Did we make a successful connection to the host talkgadget? | |
| 42 Status status_; | |
| 43 | |
| 44 // Are we currently in the middle of a check? | |
| 45 bool check_pending_; | |
| 46 | |
| 47 // Number of times we've tried to reach the talkgadget. | |
| 48 int reconnect_attempts_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(ConnectionBlockChecker); | |
| 51 }; | |
|
Sergey Ulanov
2012/08/28 00:33:42
nit: incorrect indentation
garykac
2012/08/29 00:07:15
Done.
| |
| 52 | |
| 53 } // namespace remoting | |
| 54 | |
| 55 #endif // REMOTING_HOST_CONNECTION_BLOCK_CHECKER_H_ | |
| OLD | NEW |