OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace talk_base { | 11 namespace rtc { |
12 class RateLimiter; | 12 class RateLimiter; |
13 class Timing; | 13 class Timing; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 // A very simple message throtller. User of this class must drop the packet if | 18 // A very simple message throtller. User of this class must drop the packet if |
19 // DropNextPacket returns false for that packet. This method verifies the | 19 // DropNextPacket returns false for that packet. This method verifies the |
20 // current sendrate against the required sendrate. | 20 // current sendrate against the required sendrate. |
21 | 21 |
22 class CONTENT_EXPORT P2PMessageThrottler { | 22 class CONTENT_EXPORT P2PMessageThrottler { |
23 public: | 23 public: |
24 P2PMessageThrottler(); | 24 P2PMessageThrottler(); |
25 virtual ~P2PMessageThrottler(); | 25 virtual ~P2PMessageThrottler(); |
26 | 26 |
27 void SetTiming(scoped_ptr<talk_base::Timing> timing); | 27 void SetTiming(scoped_ptr<rtc::Timing> timing); |
28 bool DropNextPacket(size_t packet_len); | 28 bool DropNextPacket(size_t packet_len); |
29 void SetSendIceBandwidth(int bandwith_kbps); | 29 void SetSendIceBandwidth(int bandwith_kbps); |
30 | 30 |
31 private: | 31 private: |
32 scoped_ptr<talk_base::Timing> timing_; | 32 scoped_ptr<rtc::Timing> timing_; |
33 scoped_ptr<talk_base::RateLimiter> rate_limiter_; | 33 scoped_ptr<rtc::RateLimiter> rate_limiter_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(P2PMessageThrottler); | 35 DISALLOW_COPY_AND_ASSIGN(P2PMessageThrottler); |
36 }; | 36 }; |
37 | 37 |
38 } // namespace content | 38 } // namespace content |
39 | 39 |
40 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ | 40 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_ |
OLD | NEW |