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

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: Remove extra comments/whitespace 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..9fe0fdd4422fcbbf175c295a76d202281ad91cf5
--- /dev/null
+++ b/remoting/host/connection_block_checker.h
@@ -0,0 +1,55 @@
+// 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"
+
+namespace remoting {
+
+class ChromotingHostContext;
+
+class ConnectionBlockChecker : public net::URLFetcherDelegate {
+ public:
+ enum Status {
+ UNKNOWN,
+ ALLOW,
+ 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.
+ };
+
+ ConnectionBlockChecker(ChromotingHostContext* context,
+ std::string talkgadget_prefix);
+ 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.
+
+ Status GetStatus();
+
+ private:
+ // net::URLFetcherDelegate interface.
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
+ 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_;
+
+ // Did we make a successful connection to the host talkgadget?
+ Status status_;
+
+ // Are we currently in the middle of a check?
+ bool check_pending_;
+
+ // Number of times we've tried to reach the talkgadget.
+ int reconnect_attempts_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectionBlockChecker);
+ };
Sergey Ulanov 2012/08/28 00:33:42 nit: incorrect indentation
garykac 2012/08/29 00:07:15 Done.
+
+} // 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