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

Unified Diff: remoting/host/connection_block_checker.h

Issue 10873050: [Chromoting] Hook up host talkgadget policy checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup logging Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/connection_block_checker.cc » ('j') | remoting/host/connection_block_checker.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/connection_block_checker.h
diff --git a/remoting/host/connection_block_checker.h b/remoting/host/connection_block_checker.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b6a71a4c087914376d9414538d688f2da1ddb6c
--- /dev/null
+++ b/remoting/host/connection_block_checker.h
@@ -0,0 +1,48 @@
+// 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_CONNECTION_BLOCK_CHECKER_H_
+#define REMOTING_HOST_CONNECTION_BLOCK_CHECKER_H_
+
+#include "net/url_request/url_fetcher_delegate.h"
+
+#include "base/callback.h"
+
+namespace remoting {
+
+class ChromotingHostContext;
+
+class ConnectionBlockChecker : public net::URLFetcherDelegate {
+ public:
+ ConnectionBlockChecker(ChromotingHostContext* context,
+ std::string talkgadget_prefix,
+ 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.
+ virtual ~ConnectionBlockChecker();
+
+ // Initiates a cecks the verify that there is a valid connection to the host
+ // 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.
+ void CheckStatus();
+
+ private:
+ // net::URLFetcherDelegate interface.
+ 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.
+
+ 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.
+ const base::Callback<void(bool)> callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectionBlockChecker);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_CONNECTION_BLOCK_CHECKER_H_
« no previous file with comments | « no previous file | remoting/host/connection_block_checker.cc » ('j') | remoting/host/connection_block_checker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698