Commit graph

17 commits

Author SHA1 Message Date
Danil Chapovalov
f6e48bf4d1 Add IWYU pragmas for some api headers
Bug: None
Change-Id: I1912e05dbc31d960f36c97151dcb387446535c71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280965
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38510}
2022-10-31 15:43:16 +00:00
Andrey Logvin
b95d90b78a Rename UNIT_TEST to WEBRTC_UNIT_TEST
Current name conflicts with upstream project code.

Bug: webrtc:12247
Change-Id: Ibd78273a75262772fc18fca688c29b9ba9525ce5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196653
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32813}
2020-12-10 11:04:58 +00:00
Danil Chapovalov
1db70d5c7b Reland "Delete legacy DataSize and DataRate factories"
This reverts commit 74c5b0ac23.

Reason for revert: downstream code adjusted

Original change's description:
> Revert "Delete legacy DataSize and DataRate factories"
>
> This reverts commit 70490aa3a0.
>
> Reason for revert: Breaks downstream project.
>
> Original change's description:
> > Delete legacy DataSize and DataRate factories
> >
> > Bug: webrtc:9709
> > Change-Id: Ia9464893ec9868c51d72eedaee8efc82b0c17b28
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168722
> > Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#30564}
>
> TBR=danilchap@webrtc.org,srte@webrtc.org
>
> Change-Id: I3f5a8b4ec473bd2af80ca3acfe0e9c82f25a12ba
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9709
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168940
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30574}

TBR=danilchap@webrtc.org,mbonadei@webrtc.org,srte@webrtc.org

Change-Id: If05a6b2aa3d4c50caac52f50c13ba56c1e2c810d
Bug: webrtc:9709
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168960
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30589}
2020-02-24 09:50:35 +00:00
Mirko Bonadei
74c5b0ac23 Revert "Delete legacy DataSize and DataRate factories"
This reverts commit 70490aa3a0.

Reason for revert: Breaks downstream project.

Original change's description:
> Delete legacy DataSize and DataRate factories
> 
> Bug: webrtc:9709
> Change-Id: Ia9464893ec9868c51d72eedaee8efc82b0c17b28
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168722
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30564}

TBR=danilchap@webrtc.org,srte@webrtc.org

Change-Id: I3f5a8b4ec473bd2af80ca3acfe0e9c82f25a12ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9709
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168940
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30574}
2020-02-20 14:42:26 +00:00
Danil Chapovalov
70490aa3a0 Delete legacy DataSize and DataRate factories
Bug: webrtc:9709
Change-Id: Ia9464893ec9868c51d72eedaee8efc82b0c17b28
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168722
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30564}
2020-02-20 09:35:48 +00:00
Danil Chapovalov
e638ada5c9 Add DataSize and DataRate factories
Bug: webrtc:9709
Change-Id: I8a3af8c62f7ed52de84efb8b1306701fa2e40278
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168606
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30533}
2020-02-17 15:18:45 +00:00
Sebastian Jansson
d7fade5738 Makes all units and operations constexpr
Since RTC_DCHECK was made constexpr compatible, we can now
make the unit classes fully constexpr.

Bug: webrtc:9883
Change-Id: I18973c2f318449869cf0bd45699c41be53fba806
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167722
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30403}
2020-01-29 10:57:54 +00:00
Danil Chapovalov
7356a5666d Remove unit_base functions FromStaticX
instead make functions FromX constexpr and use them.

Bug: None
Change-Id: I826c8ad5ac8b3bd97f298a99c40b31b8c63b5f85
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159220
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30321}
2020-01-20 13:04:56 +00:00
Sebastian Jansson
b113862ccd Allow log print of data units.
Bug: webrtc:9709
Change-Id: I5987a9779e645115dc1893944302a73d540bcf2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125680
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27578}
2019-04-12 07:36:49 +00:00
Sebastian Jansson
0c3f4d3709 Friendlier error messages from data unit classes.
By explicitly checking that the template argument is arithmetic, we
avoid exposing internal implementation details in the error message.

Bug: webrtc:9709
Change-Id: Ib1c4b46076af36fe0c4aead968487bb441d03b9a
Reviewed-on: https://webrtc-review.googlesource.com/c/112422
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25853}
2018-11-30 09:40:44 +00:00
Sebastian Jansson
72bba625d5 Adds shared base class for data units.
This reduces code duplication and ensures common behavior
between the unit classes.

Bug: webrtc:9709
Change-Id: I9529ef10b3f538355f53250a2b67c6b4e250cce8
Reviewed-on: https://webrtc-review.googlesource.com/c/110901
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25690}
2018-11-19 12:41:33 +00:00
Sebastian Jansson
af21eab531 Adds arithmetic support to DataRate.
Bug: webrtc:9709
Change-Id: Id3fde2b7bbc63c6372cadc76b92c4568665b17f9
Reviewed-on: https://webrtc-review.googlesource.com/97702
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24562}
2018-09-05 08:07:09 +00:00
Sebastian Jansson
2afd281ec4 Adds debug printing of units in unit tests.
Bug: webrtc:9656
Change-Id: I643b79bc214643f47b2b64967ce713665dbef5c9
Reviewed-on: https://webrtc-review.googlesource.com/95652
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24436}
2018-08-27 08:28:12 +00:00
Sebastian Jansson
c1c8b8e836 Adds constexpr create functions for units.
This adds new constexpr create function for DataSize, DataRate,
TimeDelta and Timestamp. The names are capitalized to mirror the
naming scheme of the previously constexpr methods (Zero and
Infinity create functions). They are also kept longer since they
are not expected to be used in complex expressions.

Bug: webrtc:9574
Change-Id: I5950548718675050fc5d66699de295455c310861
Reviewed-on: https://webrtc-review.googlesource.com/91161
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24218}
2018-08-08 07:38:14 +00:00
Sebastian Jansson
8e06419ee9 Makes units constexpr when possible.
This makes the constructor and the unchecked create functions
constexpr on the unit classes Timestamp, TimeDelta, Datarate and
DataSize. This allows using the units in constexpr constants.
Unchecked access methods are made constexpr as well. Making them
usable in static asserts.

Constexpr create functions for checked construction is added in
a separate CL.

Bug: webrtc:9574
Change-Id: I605ae2e8572195dbb2078c283056208be0f43333
Reviewed-on: https://webrtc-review.googlesource.com/91160
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24206}
2018-08-07 11:30:21 +00:00
Sebastian Jansson
942b360d82 Add conversions to and from double for units.
Bug: webrtc:8415
Change-Id: I6b1f7afb163daa327e45c51f1a3fb7cafbb1444e
Reviewed-on: https://webrtc-review.googlesource.com/78183
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23451}
2018-05-30 14:34:02 +00:00
Sebastian Jansson
6fae6ec2ee Moves network unit types to API.
This prepares for being able to inject network congestion controllers.
And makes it easier to use the units in other parts of the code.

Bug: webrtc:9155
Change-Id: Ib8f9c1c97b06d791a01c3376046933d576ae46f9
Reviewed-on: https://webrtc-review.googlesource.com/70201
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23168}
2018-05-08 11:46:22 +00:00
Renamed from modules/congestion_controller/network_control/units/data_size.h (Browse further)