Commit graph

43 commits

Author SHA1 Message Date
Tommi
3e7d35c55d Add thread checks to FifoBuffer (test-only class)
These checks replace the need for a mutex as the usage of the
StreamInterface methods is consistently on the same thread as
the callbacks.

Bug: none
Change-Id: I0c5aaddcbdaa4a6a84c3bc73306563a9f8a8821d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347902
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42148}
2024-04-23 10:50:21 +00:00
Tommi
d200488646 Introduce StreamInterface::FireEvent for firing stream events
This is a step towards removing StreamInterface::SignalEvent.
Downstream dependency will need to be updated to call FireEvent()
before further changes can land in webrtc.

Bug: webrtc:11943
Change-Id: Ia7d3f1c43fda52b7cf5bfa082aef3f462553cd67
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347884
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42143}
2024-04-23 02:33:12 +00:00
Florent Castelli
a6b9924988 Remove all usage of //rtc_base target
Bug: webrtc:9838
Change-Id: If813dbb426b4dc848185b64c0349d03fa9c059f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290986
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39116}
2023-01-16 14:36:06 +00:00
Florent Castelli
a138c6c8a5 Split rtc_base into multiple targets
Keeping the headers to allow compatibility with current users
that expect the headers to be in that target before they are
also updated.

Bug: webrtc:9838
Change-Id: I8b1e88850958e92c043686587a37791f01860220
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290569
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39031}
2023-01-09 12:21:25 +00:00
Harald Alvestrand
3e0658beec Convert FifoBuffer to new StreamInterface API
Bug: webrtc:14632
Change-Id: Id6d17d0402c5e3a0e24258c7afa38ca34e7ab227
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283541
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38640}
2022-11-16 09:53:16 +00:00
Danil Chapovalov
5286dcfab6 Migrate rtc_base and rtc_tools to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: I71abe3db7a23ad33bd175297e23fa8e927fa9628
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268768
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37553}
2022-07-19 10:57:42 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Byoungchan Lee
d197e0b876 Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
This is a reland of commit 7d4634cef7

Original change's description:
> Don't create PacketSocketFactory inside BasicPortAllocatorSession
>
> This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
>
> Bug: webrtc:13145
> Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37048}

Bug: webrtc:13145
Change-Id: Iec8091ada5862cb6aa48d45b2a426c05bda798f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264826
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Owners-Override: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37138}
2022-06-07 11:24:16 +00:00
Christoffer Jansson
25361a89dd Revert "Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession""
This reverts commit a8be79ce27.

Reason for revert: Downstream projects were not fixed and I was to eager to reland this, sorry about this.

Original change's description:
> Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
>
> This is a reland of commit 7d4634cef7
>
> Original change's description:
> > Don't create PacketSocketFactory inside BasicPortAllocatorSession
> >
> > This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
> >
> > Bug: webrtc:13145
> > Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> > Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37048}
>
> Bug: webrtc:13145
> Change-Id: I7d64c25b2942b392a1c35ff2fe1edc83d7b03746
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264503
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
> Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
> Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Cr-Commit-Position: refs/heads/main@{#37088}

Bug: webrtc:13145
Change-Id: Ie7990bae9a7c864ffaa4eb5b637618caad509633
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264823
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Owners-Override: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37089}
2022-06-02 09:45:16 +00:00
Byoungchan Lee
a8be79ce27 Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
This is a reland of commit 7d4634cef7

Original change's description:
> Don't create PacketSocketFactory inside BasicPortAllocatorSession
>
> This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
>
> Bug: webrtc:13145
> Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37048}

Bug: webrtc:13145
Change-Id: I7d64c25b2942b392a1c35ff2fe1edc83d7b03746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264503
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37088}
2022-06-02 09:31:06 +00:00
Christoffer Jansson
6b9e040ab2 Revert "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
This reverts commit 7d4634cef7.

Reason for revert: Breaks downstream project.

Original change's description:
> Don't create PacketSocketFactory inside BasicPortAllocatorSession
>
> This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
>
> Bug: webrtc:13145
> Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37048}

Bug: webrtc:13145
Change-Id: Iacddd280f9f27b703f2a03ee568722aed8d3abc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264463
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Christoffer Jansson <jansson@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37053}
2022-05-31 09:22:24 +00:00
Byoungchan Lee
7d4634cef7 Don't create PacketSocketFactory inside BasicPortAllocatorSession
This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.

Bug: webrtc:13145
Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37048}
2022-05-31 00:58:04 +00:00
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +00:00
Harald Alvestrand
00579e8bce Use AlwaysValidPointer in connection_context
This extends AlwaysValidPointer to take a lambda for its default
rather than requesting a constructor.

Bug: none
Change-Id: Ied97968c3f511af15422a1eef9801d14d4ec5b96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260580
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36745}
2022-05-03 13:39:06 +00:00
Jonas Oreland
6c7f98472e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 16/inf
This cl/ adds the feature actually injecting a FieldTrialsView into
PeerConnectionFactory, or into a PeerConnection or both.

The field trials used for a PeerConnection is those specified in
PeerConnectionDependencies. Otherwise will those from
PeerConnectionFactoryDependencies be used (and until we're finished with
this conversion, the global string fallback is used as last resort).

Note that it is currently not possible to create 2 FieldTrials
objects concurrently...due to global string,
so this cl/ is mostly (but entirely) for show, i.e one _can_
realistically inject them into a PeerConnectionFactory.


Bug: webrtc:10335
Change-Id: Id2e60525f48a1f8293c1dd0be771e3ed03790963
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258134
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36578}
2022-04-20 06:35:27 +00:00
Jonas Oreland
c06fe8b04e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 11/inf
convert rtc_base/network and collateral.

This also remove last usage of system_wrappers/field_trials
in p2p/...Yay!

Bug: webrtc:10335
Change-Id: Ie8507b1f52bf7f3067e9b4bf8c81a825e4644fda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36357}
2022-03-28 15:48:01 +00:00
Jonas Oreland
e0e91a624a AlwaysValidPointer - forwarding constructor and tests
Bug: webrtc:10335
Change-Id: I1305ccf8d4f1b25f89fef7d26b090741d5f57f7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256106
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36264}
2022-03-19 00:31:37 +00:00
Jonas Oreland
66eb789b41 Add class for pointer or owned object.
To be used as part of field trial conversion effort.

Bug: webrtc:10335
Change-Id: Iaeff520d5a83331926ead945c9e414716e61cac8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256013
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36259}
2022-03-18 15:24:57 +00:00
Byoungchan Lee
14af7622a7 Remove RTC_DISALLOW_COPY_AND_ASSIGN from rtc_base/
Bug: webrtc:13555, webrtc:13082
Change-Id: I406b7f04497562866ea3329e97c5adc96e927b6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35691}
2022-01-13 20:42:15 +00:00
Niels Möller
acf4f55df3 Delete unused FifoBuffer methods
Unused since https://webrtc-review.googlesource.com/c/src/+/186665

Bug: webrtc:11988, webrtc:6424
Change-Id: Ib09e6b862f7550d07d5adf8ce82b74698419730a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233081
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35097}
2021-09-27 14:32:47 +00:00
Artem Titov
96e3b991da Use backticks not vertical bars to denote variables in comments for /rtc_base
Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
2021-07-28 13:51:47 +00:00
Niels Möller
9040f8e34a Mark rtc_base/memory:fifo_buffer as testonly
Bug: webrtc:6424
Change-Id: Ifae66027f2cd308650b07dd4b02bcb1d75a69111
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213144
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33581}
2021-03-29 10:15:44 +00:00
Mirko Bonadei
e5f4c6b8d2 Reland "Refactor rtc_base build targets."
This is a reland of 69241a93fb

Fix: The problem was related to NO_MAIN_THREAD_WRAPPING, which
affects https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_base/thread.cc;l=257-263;drc=7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5.
The original CL didn't attach the definition of the macro
NO_MAIN_THREAD_WRAPPING when building for Chromium (which doesn't have
to be related to //rtc_base anymore but to //rtc_base:threading).

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

Bug: webrtc:9987
Change-Id: I7cdf49d2aac8357f1f50f90010bf2c2f62fa19f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202021
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33001}
2021-01-15 17:00:05 +00:00
Mirko Bonadei
7acc2d9fe3 Revert "Refactor rtc_base build targets."
This reverts commit 69241a93fb.

Reason for revert: Breaks WebRTC roll into Chromium.

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

TBR=mbonadei@webrtc.org,hta@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

No-Try: True
Bug: webrtc:9987
Change-Id: I1e36ad64cc60092f38d6886153a94f1a58339256
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201840
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32986}
2021-01-14 21:27:38 +00:00
Mirko Bonadei
69241a93fb Refactor rtc_base build targets.
The "//rtc_base:rtc_base" build target has historically been one of the
biggest targets in the WebRTC build. Big targets are the main source of
circular dependencies and non-API types leakage.

This CL is a step forward into splitting "//rtc_base:rtc_base" into
smaller targets (as originally started in 2018).

The only non-automated changes are (like re-wiring the build system):
* The creation of //rtc_base/async_resolver.{h,cc} which allows to
  break a circular dependency (is has been extracted from
  //rtc_base/net_helpers.{h,cc}).
* The creation of //rtc_base/internal/default_socket_server.{h,cc} to
  break another circular dependency.

Bug: webrtc:9987
Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32941}
2021-01-11 18:32:30 +00:00
Tommi
04482985b2 Revert "[Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface.""
This reverts commit af05c833da.

Reason for revert: The failure in remoting_unittests has been addressed.

Original change's description:
> [Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface."
>
> This reverts commit eb79dd9ffd.
>
> Reason for revert: breaks WebRTC roll into Chrome:
> https://crrev.com/c/2445696
>
> Sample failure:
> https://ci.chromium.org/p/chromium/builders/try/linux-rel/506049
> [ RUN      ] PseudoTcpAdapterTest.DeleteOnConnected
>
> Original change's description:
> > Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
> >
> > This includes relying on related types such as MessageData and
> > PostEvent functionality inside the StreamInterface itself.
> >
> > This affects mostly tests but OpenSSLStreamAdapter
> > requires special attention.
> >
> > Bug: webrtc:11988
> > Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32290}
>
> TBR=kwiberg@webrtc.org,tommi@webrtc.org
>
> Change-Id: I23d7a311a73c739eba872a21e6123235465c28cc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11988
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186564
> Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
> Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32299}

TBR=kwiberg@webrtc.org,tommi@webrtc.org,marinaciocea@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11988
Change-Id: Iff07e0943fc5dded9eeed5c2626798691594300d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186700
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32314}
2020-10-05 13:46:03 +00:00
Marina Ciocea
af05c833da [Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface."
This reverts commit eb79dd9ffd.

Reason for revert: breaks WebRTC roll into Chrome:
https://crrev.com/c/2445696

Sample failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/506049
[ RUN      ] PseudoTcpAdapterTest.DeleteOnConnected

Original change's description:
> Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
>
> This includes relying on related types such as MessageData and
> PostEvent functionality inside the StreamInterface itself.
>
> This affects mostly tests but OpenSSLStreamAdapter
> requires special attention.
>
> Bug: webrtc:11988
> Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32290}

TBR=kwiberg@webrtc.org,tommi@webrtc.org

Change-Id: I23d7a311a73c739eba872a21e6123235465c28cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11988
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186564
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32299}
2020-10-02 20:40:50 +00:00
Tomas Gunnarsson
eb79dd9ffd Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
This includes relying on related types such as MessageData and
PostEvent functionality inside the StreamInterface itself.

This affects mostly tests but OpenSSLStreamAdapter
requires special attention.

Bug: webrtc:11988
Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32290}
2020-10-02 11:58:13 +00:00
Markus Handell
18523c34b4 Migrate rtc_base to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: Ib8630e0cf1266e7c3f8ce718e1ed9f8848f42ec8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178806
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31682}
2020-07-08 20:38:54 +00:00
Niels Möller
dbf5416a80 Delete header file rtc_base/memory/aligned_array.h
Move definition of AlignedArray to the only code using it, the
test-only LappedTransform class, and delete unused methods.

Bug: webrtc:6424, webrtc:9577
Change-Id: I1bb5f57400f7217345b7ec7376235ad4c4bae858
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168701
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30576}
2020-02-20 14:55:25 +00:00
Mirko Bonadei
ccbe95fd8a Reformat GN files.
`gn format` recently [1] changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

CL generated with:
$ git ls-files | grep BUILD.gn | xargs gn format
$ gn format build_overrides/build.gni
$ gn format build_overrides/gtest.gni
$ gn format modules/audio_coding/audio_coding.gni
$ gn format webrtc.gni
$ gn format .gn

Plus a few manual changes to add exceptions for
"public_deps" (after changing these lines the presubmit
started to complain).

[1] - https://gn-review.googlesource.com/c/gn/+/6860

Bug: webrtc:11302
Change-Id: Iac29d23c1618ebef925c972e2891cd9f4e8cd613
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166882
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30334}
2020-01-21 12:13:11 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Ilya Nikolaevskiy
40409c141a Crash with error message if failed to allocate memory via AlignedMalloc
Bug: webrtc:10573
Change-Id: I26d443a0422e7bad7148d2acf422f0dfdf4dcb8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134218
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27795}
2019-04-28 11:16:40 +00:00
Mirko Bonadei
a7d8f19a77 Use 'public_deps' to depend on nacl_io [1].
Some NaCl system headers live in a special directory and the
toolchain doesn't propagate the -I compiler flag [2].

A common workaround in Chromium is to use 'public_deps' in order
to propagate //native_client_sdk/src/libraries/nacl_io:nacl_io_include_dirs
one step further in the build graph.

[1] - https://cs.chromium.org/chromium/src/native_client_sdk/src/libraries/nacl_io/
[2] - -Inative_client_sdk/src/libraries/third_party/newlib-extras

Bug: chromium:925028
Change-Id: I5145b80c2ae6969f79fcbfcf93a6b05c8a122746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129701
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27373}
2019-03-31 12:58:02 +00:00
Niels Möller
13339483a4 Move FifoBuffer to its own file and build target
Used only by test code and by pseudo_tcp.

Bug: webrtc:6424
Change-Id: I28903e74f7b69cbdd8c368f4444c8a233eb76868
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128868
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27341}
2019-03-28 13:33:30 +00:00
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00
Yves Gerey
2e00abc98e Reland "[cleanup] Remove useless includes."
Reason for reland: Downstream project fixed.

Original change's description:

> [cleanup] Remove useless includes.
>
> Manual cleanup guided by include-what-you-use diagnostic.
>
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

Bug: webrtc:8311
Change-Id: Id6ec4aeb798886a90ace640a190eaf16497ba31b
Reviewed-on: https://webrtc-review.googlesource.com/c/104120
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25034}
2018-10-08 07:44:19 +00:00
Oleh Prypin
96a0f61917 Revert "[cleanup] Remove useless includes."
This reverts commit be8b5348c7.

Reason for revert: Breaks downstream project

Original change's description:
> [cleanup] Remove useless includes.
> 
> Manual cleanup guided by include-what-you-use diagnostic.
> 
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

TBR=phoglund@google.com,phoglund@webrtc.org,yvesg@webrtc.org

Change-Id: I7a6e1cdfef685173b76f234ad598083043dcd9a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8311
Reviewed-on: https://webrtc-review.googlesource.com/c/104022
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25015}
2018-10-05 13:13:45 +00:00
Yves Gerey
be8b5348c7 [cleanup] Remove useless includes.
Manual cleanup guided by include-what-you-use diagnostic.

Bug: webrtc:8311
Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
Reviewed-on: https://webrtc-review.googlesource.com/c/103320
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25013}
2018-10-05 11:51:06 +00:00
Mirko Bonadei
7880be1799 Don't include <memory.h> in aligned_malloc.cc.
The inclusion of <memory.h> creates problems when building with Chromium
third_party/webrtc/rtc_base/memory/aligned_malloc.cc:13:10:
  fatal error: 'memory.h' file not found
    #include <memory.h>

It seems the code doesn't need to include <memory.h> but <cstring>.

Bug: None
Change-Id: Ib6591711aa7cfea49a2ff08321cfb3bd3689797a
Reviewed-on: https://webrtc-review.googlesource.com/c/103980
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25003}
2018-10-05 07:44:46 +00:00
Niels Möller
a12c42a6b2 Delete root header file typedef.h.
Usage replaced with stdint.h, rtc_base/system/arch.h and
rtc_base/system/unused.h, as appropriate.

Bug: webrtc:6854
Change-Id: I97225465d14b969903d92979e2df3c3c05d35f18
Reviewed-on: https://webrtc-review.googlesource.com/90249
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24100}
2018-07-25 14:59:26 +00:00
Karl Wiberg
29e7bee330 Move aligned memory utilities to rtc_base/memory/
This moves them from an API directory (system_wrappers/include/) to a
non-API directory, which is exactly what we want for utilities like
this.

BUG=webrtc:8445

Change-Id: I6dc34fe662f5d87b3b5288d33055345bc6bf91db
Reviewed-on: https://webrtc-review.googlesource.com/21164
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22567}
2018-03-22 14:13:24 +00:00