Add ICU message format support
[chromium-blink-merge.git] / content / browser / renderer_host / p2p / socket_host_throttler.h
bloba28a58856218f2adfe010598265898b591b1926c
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/content_export.h"
11 namespace rtc {
12 class RateLimiter;
13 class Timing;
16 namespace content {
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
20 // current sendrate against the required sendrate.
22 class CONTENT_EXPORT P2PMessageThrottler {
23 public:
24 P2PMessageThrottler();
25 virtual ~P2PMessageThrottler();
27 void SetTiming(scoped_ptr<rtc::Timing> timing);
28 bool DropNextPacket(size_t packet_len);
29 void SetSendIceBandwidth(int bandwith_kbps);
31 private:
32 scoped_ptr<rtc::Timing> timing_;
33 scoped_ptr<rtc::RateLimiter> rate_limiter_;
35 DISALLOW_COPY_AND_ASSIGN(P2PMessageThrottler);
38 } // namespace content
40 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_THROTTLER_H_