diff --git a/api/BUILD.gn b/api/BUILD.gn index f66101eee2..e3ab5dc73b 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -190,6 +190,7 @@ rtc_library("libjingle_peerconnection_api") { ":scoped_refptr", ":sequence_checker", "../call:rtp_interfaces", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:network_constants", "../rtc_base:refcount", diff --git a/api/test/network_emulation/BUILD.gn b/api/test/network_emulation/BUILD.gn index a8044d7230..acff7124d7 100644 --- a/api/test/network_emulation/BUILD.gn +++ b/api/test/network_emulation/BUILD.gn @@ -21,6 +21,7 @@ rtc_library("network_emulation") { "../..:array_view", "../../../rtc_base", "../../../rtc_base:checks", + "../../../rtc_base:copy_on_write_buffer", "../../../rtc_base:ip_address", "../../../rtc_base:rtc_base_approved", "../../../rtc_base:socket_address", diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn index 127452f7a2..03322257cc 100644 --- a/api/transport/BUILD.gn +++ b/api/transport/BUILD.gn @@ -65,6 +65,7 @@ rtc_source_set("datagram_transport_interface") { deps = [ "..:array_view", "..:rtc_error", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:rtc_base_approved", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] diff --git a/call/BUILD.gn b/call/BUILD.gn index 3436460e67..c759736fb1 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -71,6 +71,7 @@ rtc_library("call_interfaces") { "../rtc_base", "../rtc_base:audio_format_to_string", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:refcount", "../rtc_base:rtc_base_approved", "../rtc_base:stringutils", @@ -320,6 +321,7 @@ rtc_library("call") { "../modules/utility", "../modules/video_coding", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:location", "../rtc_base:logging", "../rtc_base:macromagic", diff --git a/media/BUILD.gn b/media/BUILD.gn index c3bb5f0b43..09be87a598 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -82,6 +82,7 @@ rtc_library("rtc_media_base") { "../rtc_base:buffer", "../rtc_base:byte_order", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:macromagic", "../rtc_base:rtc_base_approved", @@ -299,6 +300,7 @@ rtc_library("rtc_audio_video") { "../rtc_base:buffer", "../rtc_base:byte_order", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:ignore_wundef", "../rtc_base:logging", "../rtc_base:macromagic", @@ -392,6 +394,7 @@ rtc_source_set("rtc_data_sctp_transport_internal") { "../api/transport:datagram_transport_interface", "../media:rtc_media_base", "../p2p:rtc_p2p", + "../rtc_base:copy_on_write_buffer", "../rtc_base:rtc_base_approved", "../rtc_base:threading", "../rtc_base/third_party/sigslot", @@ -416,6 +419,7 @@ if (rtc_build_dcsctp) { "../net/dcsctp/timer:task_queue_timeout", "../p2p:rtc_p2p", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:random", "../rtc_base:rtc_base_approved", @@ -501,6 +505,7 @@ if (rtc_include_tests) { "../rtc_base:buffer", "../rtc_base:byte_order", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:gunit_helpers", "../rtc_base:macromagic", "../rtc_base:rtc_base_approved", diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn index 8e10910aba..b1847cefea 100644 --- a/modules/audio_coding/BUILD.gn +++ b/modules/audio_coding/BUILD.gn @@ -1104,6 +1104,7 @@ rtc_library("neteq_tools_minimal") { "../../api/neteq:neteq_api", "../../rtc_base:buffer", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:rtc_base_approved", "../../rtc_base:safe_conversions", "../../rtc_base:stringutils", diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn index 5ae567c4ff..434b1e615d 100644 --- a/modules/rtp_rtcp/BUILD.gn +++ b/modules/rtp_rtcp/BUILD.gn @@ -122,6 +122,7 @@ rtc_library("rtp_rtcp_format") { "../../rtc_base:bitstream_reader", "../../rtc_base:buffer", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:divide_round", "../../rtc_base:logging", "../../rtc_base:macromagic", @@ -299,6 +300,7 @@ rtc_library("rtp_rtcp") { "../../rtc_base:buffer", "../../rtc_base:byte_buffer", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:divide_round", "../../rtc_base:gtest_prod", "../../rtc_base:logging", @@ -398,6 +400,7 @@ rtc_library("rtcp_transceiver") { "../../api/units:timestamp", "../../api/video:video_bitrate_allocation", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:divide_round", "../../rtc_base:logging", "../../rtc_base:rtc_base_approved", @@ -635,6 +638,7 @@ if (rtc_include_tests) { "../../rtc_base:bit_buffer", "../../rtc_base:buffer", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:random", diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 9f6cf70892..783ec86309 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -114,6 +114,7 @@ rtc_library("packet_buffer") { "../../api/video:video_frame_type", "../../common_video", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:mod_ops", @@ -143,6 +144,7 @@ rtc_library("h264_packet_buffer") { "../../api/video:video_frame_type", "../../common_video", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:logging", "../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_numerics", @@ -340,6 +342,7 @@ rtc_library("video_coding") { "../../common_video", "../../rtc_base", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:rtc_base_approved", diff --git a/net/dcsctp/socket/BUILD.gn b/net/dcsctp/socket/BUILD.gn index 504d0c1188..80b9f56f0c 100644 --- a/net/dcsctp/socket/BUILD.gn +++ b/net/dcsctp/socket/BUILD.gn @@ -236,6 +236,7 @@ if (rtc_include_tests) { "../../../api/units:time_delta", "../../../call:simulated_network", "../../../rtc_base:checks", + "../../../rtc_base:copy_on_write_buffer", "../../../rtc_base:gunit_helpers", "../../../rtc_base:logging", "../../../rtc_base:rtc_base_approved", diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index e590220220..b63e50c18d 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -158,6 +158,7 @@ if (rtc_include_tests) { ":rtc_p2p", "../api:libjingle_peerconnection_api", "../rtc_base", + "../rtc_base:copy_on_write_buffer", "../rtc_base:rtc_base_approved", "../rtc_base/task_utils:pending_task_safety_flag", "../rtc_base/task_utils:to_queued_task", @@ -205,6 +206,7 @@ if (rtc_include_tests) { "../api/transport:stun_types", "../rtc_base", "../rtc_base:async_resolver_interface", + "../rtc_base:copy_on_write_buffer", "../rtc_base:gunit_helpers", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_utils", @@ -261,6 +263,7 @@ if (rtc_include_tests) { "../rtc_base:buffer", "../rtc_base:byte_buffer", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:gunit_helpers", "../rtc_base:ip_address", "../rtc_base:location", diff --git a/pc/BUILD.gn b/pc/BUILD.gn index df86e4c083..8509784192 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -83,6 +83,7 @@ rtc_source_set("channel") { "../p2p:rtc_p2p", "../rtc_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:location", "../rtc_base:logging", "../rtc_base:macromagic", @@ -249,6 +250,7 @@ rtc_source_set("jsep_transport") { "../p2p:rtc_p2p", "../rtc_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:macromagic", "../rtc_base:refcount", @@ -317,6 +319,7 @@ rtc_source_set("jsep_transport_controller") { "../rtc_base", "../rtc_base:callback_list", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:location", "../rtc_base:logging", "../rtc_base:macromagic", @@ -463,6 +466,7 @@ rtc_source_set("rtp_transport") { "../p2p:rtc_p2p", "../rtc_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:rtc_base_approved", "../rtc_base:socket", @@ -501,6 +505,7 @@ rtc_source_set("sctp_data_channel_transport") { "../api/transport:datagram_transport_interface", "../media:rtc_data_sctp_transport_internal", "../media:rtc_media_base", + "../rtc_base:copy_on_write_buffer", "../rtc_base:rtc_base_approved", "../rtc_base/third_party/sigslot", ] @@ -547,6 +552,7 @@ rtc_source_set("sctp_utils") { "../api/transport:datagram_transport_interface", "../media:rtc_media_base", "../rtc_base:byte_buffer", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:rtc_base_approved", ] @@ -626,6 +632,7 @@ rtc_source_set("srtp_transport") { "../rtc_base", "../rtc_base:buffer", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:logging", "../rtc_base:rtc_base_approved", "../rtc_base:safe_conversions", @@ -896,6 +903,7 @@ rtc_library("sctp_data_channel") { "../media:rtc_data_sctp_transport_internal", "../media:rtc_media_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:location", "../rtc_base:logging", "../rtc_base:macromagic", @@ -978,6 +986,7 @@ rtc_source_set("data_channel_controller") { "../media:rtc_media_base", "../rtc_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:location", "../rtc_base:logging", "../rtc_base:macromagic", @@ -1230,6 +1239,7 @@ rtc_source_set("peer_connection") { "../p2p:rtc_p2p", "../rtc_base", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:ip_address", "../rtc_base:location", "../rtc_base:logging", @@ -2129,6 +2139,7 @@ if (rtc_include_tests && !build_with_chromium) { "../rtc_base:buffer", "../rtc_base:byte_order", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:gunit_helpers", "../rtc_base:location", "../rtc_base:logging", @@ -2384,6 +2395,7 @@ if (rtc_include_tests && !build_with_chromium) { "../p2p:p2p_server_utils", "../rtc_base:byte_buffer", "../rtc_base:checks", + "../rtc_base:copy_on_write_buffer", "../rtc_base:gunit_helpers", "../rtc_base:ip_address", "../rtc_base:location", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 4acea37b75..6f64fb3b3e 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -88,6 +88,7 @@ rtc_library("rtc_base_approved") { ":byte_buffer", ":byte_order", ":checks", + ":copy_on_write_buffer", ":histogram_percentile_counter", ":location", ":logging", @@ -135,8 +136,7 @@ rtc_library("rtc_base_approved") { "buffer_queue.h", # Transitional, use :buffer_queue "byte_buffer.h", # Transitional, use :byte_buffer "byte_order.h", # Transitional, use :byte_order - "copy_on_write_buffer.cc", - "copy_on_write_buffer.h", + "copy_on_write_buffer.h", # Transitional, use :copy_on_write_buffer "event_tracer.cc", "event_tracer.h", "location.h", # Transitional, use :location @@ -290,6 +290,22 @@ rtc_library("buffer_queue") { ] } +rtc_library("copy_on_write_buffer") { + visibility = [ "*" ] + sources = [ + "copy_on_write_buffer.cc", + "copy_on_write_buffer.h", + ] + deps = [ + ":buffer", + ":checks", + ":refcount", + ":type_traits", + "../api:scoped_refptr", + "system:rtc_export", + ] +} + rtc_library("histogram_percentile_counter") { visibility = [ "*" ] sources = [ @@ -1145,6 +1161,7 @@ rtc_library("rtc_base") { ":byte_order", ":callback_list", ":checks", + ":copy_on_write_buffer", ":ip_address", ":location", ":logging", @@ -1638,6 +1655,7 @@ if (rtc_include_tests) { ":byte_buffer", ":byte_order", ":checks", + ":copy_on_write_buffer", ":criticalsection", ":divide_round", ":gunit_helpers", diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index a0c45d4b96..6f46415178 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -173,6 +173,7 @@ webrtc_fuzzer_test("ulpfec_generator_fuzzer") { "../../modules/rtp_rtcp:fec_test_helper", "../../modules/rtp_rtcp:rtp_rtcp_format", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:rtc_base_approved", "../../system_wrappers", ] @@ -661,6 +662,7 @@ webrtc_fuzzer_test("sctp_utils_fuzzer") { "../../api:libjingle_peerconnection_api", "../../pc:libjingle_peerconnection", "../../pc:sctp_utils", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:rtc_base_approved", ] } diff --git a/test/network/BUILD.gn b/test/network/BUILD.gn index adaa2d4da4..62ad48a82a 100644 --- a/test/network/BUILD.gn +++ b/test/network/BUILD.gn @@ -57,6 +57,7 @@ rtc_library("emulated_network") { "../../p2p:p2p_server_utils", "../../p2p:rtc_p2p", "../../rtc_base", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:ip_address", "../../rtc_base:logging", "../../rtc_base:macromagic", diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn index 9f798815d2..3147e901e5 100644 --- a/test/scenario/BUILD.gn +++ b/test/scenario/BUILD.gn @@ -125,6 +125,7 @@ if (rtc_include_tests && !build_with_chromium) { "../../modules/video_coding:webrtc_vp9", "../../rtc_base", "../../rtc_base:checks", + "../../rtc_base:copy_on_write_buffer", "../../rtc_base:refcount", "../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_tests_utils",