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

Unified Diff: remoting/host/plugin/host_script_object.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: silly compiler. 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/host_script_object.h
diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h
index 03d14c32c32540bb39b95a67ab367cd0bba428af..7624155a1670946077d1070e4969051dd4e9baee 100644
--- a/remoting/host/plugin/host_script_object.h
+++ b/remoting/host/plugin/host_script_object.h
@@ -34,6 +34,10 @@ class RegisterSupportHostRequest;
class SignalStrategy;
class SupportAccessVerifier;
+namespace policy_hack {
+class NatPolicy;
+} // namespace policy_hack
+
// NPAPI plugin implementation for remoting host script object.
// HostNPScriptObject creates threads that are required to run
// ChromotingHost and starts/stops the host on those threads. When
@@ -110,11 +114,18 @@ class HostNPScriptObject : public HostStatusObserver {
void ConnectInternal(const std::string& uid,
const std::string& auth_token,
const std::string& auth_service);
+ void ReadPolicyAndConnect(const std::string& uid,
+ const std::string& auth_token,
+ const std::string& auth_service);
+ void InitNatPolicy();
void DisconnectInternal();
// Callback for ChromotingHost::Shutdown().
void OnShutdownFinished();
+ // Called when the nat traversal policy is updated.
+ void OnNatPolicyUpdate(bool nat_traversal_enabled);
+
// Helper function for executing InvokeDefault on an NPObject, and ignoring
// the return value.
bool InvokeAndIgnoreResult(NPObject* func,
@@ -151,6 +162,13 @@ class HostNPScriptObject : public HostStatusObserver {
base::WaitableEvent disconnected_event_;
base::CancellationFlag destructing_;
+
+ // This object must always be created/deleted on the network thread.
+ policy_hack::NatPolicy* nat_policy_;
+
+ bool nat_traversal_enabled_;
+ bool policy_received_;
+ base::Closure pending_connect_;
};
} // namespace remoting
« no previous file with comments | « no previous file | remoting/host/plugin/host_script_object.cc » ('j') | remoting/host/plugin/host_script_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698