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

Unified Diff: remoting/host/plugin/policy_hack/nat_policy.h

Issue 7599017: Framework to allow Chromoting host to respect NAT traversal policy in linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1-char comment typo Created 9 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
Index: remoting/host/plugin/policy_hack/nat_policy.h
diff --git a/remoting/host/plugin/policy_hack/nat_policy.h b/remoting/host/plugin/policy_hack/nat_policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..02bc1652e6a4363475613157572086d30d5b657c
--- /dev/null
+++ b/remoting/host/plugin/policy_hack/nat_policy.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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_PLUGIN_POLICY_HACK_NAT_POLICY_H_
+#define REMOTING_HOST_PLUGIN_POLICY_HACK_NAT_POLICY_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+
+class MessageLoop;
+
+namespace base {
+class WaitableEvent;
+} // namespace base
+
+namespace remoting {
+namespace policy_hack {
+
+// Watches the policy files for a change to the remote access host NAT
dmac 2011/08/11 18:42:55 this is not actually true for all platforms. How a
awong 2011/08/11 19:04:07 done
+// policies.
+class NatPolicy {
+ public:
+ // Called with the current status of whether or not NAT traversal is enabled.
+ typedef base::Callback<void(bool)> NatEnabledCallback;
+
+ NatPolicy() {}
+ virtual ~NatPolicy() {}
+
+ // This guarantees that the policy_update_cb is called at least once with the
+ // current policy.
+ virtual void StartWatching() = 0;
+
+ virtual void StopWatching(base::WaitableEvent* done) = 0;
+
+ // Implemented by each platform.
Wez 2011/08/11 20:00:27 Document which MessageLoop needs to be passed, and
awong 2011/08/11 23:54:54 Done.
+ static NatPolicy* Create(MessageLoop* message_loop,
+ const NatEnabledCallback& policy_update_cb);
+};
+
+} // namespace policy_hack
+} // namespace remoting
+
+#endif // REMOTING_HOST_PLUGIN_POLICY_HACK_NAT_POLICY_H_

Powered by Google App Engine
This is Rietveld 408576698