Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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_PLUGIN_POLICY_HACK_NAT_POLICY_H_ | |
| 6 #define REMOTING_HOST_PLUGIN_POLICY_HACK_NAT_POLICY_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 | |
| 11 class MessageLoop; | |
| 12 | |
| 13 namespace base { | |
| 14 class WaitableEvent; | |
| 15 } // namespace base | |
| 16 | |
| 17 namespace remoting { | |
| 18 namespace policy_hack { | |
| 19 | |
| 20 // 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
| |
| 21 // policies. | |
| 22 class NatPolicy { | |
| 23 public: | |
| 24 // Called with the current status of whether or not NAT traversal is enabled. | |
| 25 typedef base::Callback<void(bool)> NatEnabledCallback; | |
| 26 | |
| 27 NatPolicy() {} | |
| 28 virtual ~NatPolicy() {} | |
| 29 | |
| 30 // This guarantees that the policy_update_cb is called at least once with the | |
| 31 // current policy. | |
| 32 virtual void StartWatching() = 0; | |
| 33 | |
| 34 virtual void StopWatching(base::WaitableEvent* done) = 0; | |
| 35 | |
| 36 // 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.
| |
| 37 static NatPolicy* Create(MessageLoop* message_loop, | |
| 38 const NatEnabledCallback& policy_update_cb); | |
| 39 }; | |
| 40 | |
| 41 } // namespace policy_hack | |
| 42 } // namespace remoting | |
| 43 | |
| 44 #endif // REMOTING_HOST_PLUGIN_POLICY_HACK_NAT_POLICY_H_ | |
| OLD | NEW |