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 #include "base/callback.h" | |
| 11 | |
| 12 namespace remoting { | |
| 13 | |
| 14 class ChromotingHostContext; | |
| 15 | |
| 16 class ConnectionBlockChecker : public net::URLFetcherDelegate { | |
| 17 public: | |
| 18 ConnectionBlockChecker(ChromotingHostContext* context, | |
| 19 std::string talkgadget_prefix, | |
| 20 const base::Callback<void(bool)>& callback); | |
|
Sergey Ulanov
2012/08/29 20:10:29
it would be cleaner to pass callback to CheckStatu
garykac
2012/08/29 22:30:51
Done.
| |
| 21 virtual ~ConnectionBlockChecker(); | |
| 22 | |
| 23 // Initiates a cecks the verify that there is a valid connection to the host | |
| 24 // talkgadget. Calls |callback_| with the result. | |
|
Sergey Ulanov
2012/08/29 20:10:29
nit: Calls the the |callback| specified in the con
garykac
2012/08/29 22:30:51
Done.
| |
| 25 void CheckStatus(); | |
| 26 | |
| 27 private: | |
| 28 // net::URLFetcherDelegate interface. | |
| 29 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | |
|
Sergey Ulanov
2012/08/29 20:10:29
interface implementation must be public.
garykac
2012/08/29 22:30:51
Done.
| |
| 30 | |
| 31 ChromotingHostContext* context_; | |
| 32 | |
| 33 // URL fetcher used to verify access to the host talkgadget. | |
| 34 scoped_ptr<net::URLFetcher> url_fetcher_; | |
| 35 | |
| 36 // The string pre-pended to '.talkgadget.google.com' to create the full | |
| 37 // talkgadget domain name for the host. | |
| 38 std::string talkgadget_prefix_; | |
| 39 | |
| 40 // Called with the results of the connection check. | |
| 41 const base::Callback<void(bool)> callback_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(ConnectionBlockChecker); | |
| 44 }; | |
| 45 | |
| 46 } // namespace remoting | |
| 47 | |
| 48 #endif // REMOTING_HOST_CONNECTION_BLOCK_CHECKER_H_ | |
| OLD | NEW |