Skip to content

Commit ec3d975

Browse files
baylesjactions-user
authored andcommitted
[Code Health] Remove Abseil usages
This patch removes the remaining Abseil usages outside of the protobuf messaging dependencies. Some C++20 modernizations are included, espeically in the CDDL code. Bug: 158433927 Change-Id: Ibcb865e6ae712f905e8453df8e9a30f7a5291dca Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/7585316 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
1 parent bae1f28 commit ec3d975

65 files changed

Lines changed: 1310 additions & 1455 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Exact OpenScreen Mirror with .github Protection
2+
3+
on:
4+
workflow_dispatch: # Manuel olarak tetiklenebilir
5+
schedule:
6+
- cron: '0 0 */3 * *' # Her 3 günde bir otomatik olarak çalışır
7+
8+
jobs:
9+
mirror:
10+
runs-on: ubuntu-latest # İş akışı Ubuntu üzerinde çalışır
11+
steps:
12+
# Adım 1: Mevcut depoyu tam tarihçe ile al
13+
- name: Checkout Full History
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Tüm commit geçmişini al
17+
18+
# Adım 2: OpenScreen verilerini mevcut depoya entegre et
19+
- name: Integrate OpenScreen
20+
run: |
21+
# 'actions' branch'ine geç
22+
git checkout actions
23+
24+
# OpenScreen'i uzak depo olarak ekle
25+
git remote add openscreen https://chromium.googlesource.com/openscreen
26+
27+
# OpenScreen'den tüm branch'leri ve tag'leri al
28+
git fetch openscreen --tags
29+
30+
# OpenScreen'deki tüm branch'leri yerel olarak oluştur (main hariç)
31+
git branch -r | grep 'openscreen/' | grep -v 'HEAD' | while read remote; do
32+
branch_name=${remote#openscreen/}
33+
git branch -f "$branch_name" "$remote"
34+
done
35+
36+
# Adım 3: Main branch'i koru ve .github dosyalarını güncelle
37+
- name: Protect Main Branch
38+
run: |
39+
# Main branch'e geç
40+
git checkout main
41+
42+
# Git kullanıcı bilgilerini ayarla (commit için)
43+
git config user.name "GitHub Actions"
44+
git config user.email "actions@github.com"
45+
46+
# 'actions' branch'inden .github klasörünü al ve main branch'ine merge et
47+
git checkout actions -- .github
48+
git add .github
49+
git commit --amend --no-edit # Commit'i güncelle (fast-forward olmadan)
50+
51+
# Adım 4: Tüm branch'leri ve tag'leri force push et
52+
- name: Force Push Mirrored Branches
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token'ı kullan
55+
run: |
56+
# Tüm branch'leri ve tag'leri force push et
57+
git push origin --all --force
58+
git push origin --tags --force

BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ openscreen_source_set("openscreen_unittests_all") {
8585
"cast/streaming:unittests",
8686
"cast/test:unittests",
8787
"platform:unittests",
88-
"third_party/abseil",
8988
"util:unittests",
9089
]
9190

DEPS

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,9 @@ include_rules = [
459459
'+discovery/mdns/public',
460460
'+discovery/public',
461461

462-
# Don't include abseil from the root so the path can change via include_dirs
463-
# rules when in Chromium.
462+
# Don't include Abseil.
464463
'-third_party/abseil',
465-
466-
# Abseil allowed headers.
467-
# IMPORTANT: Do not add new entries; abseil is being removed from the library.
468-
# See https://issuetracker.google.com/158433927
469-
'+absl/types/variant.h',
464+
'-absl',
470465

471466
# Similar to abseil, don't include boringssl using root path. Instead,
472467
# explicitly allow 'openssl' where needed.

build_overrides/build.gni

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ build_with_chromium = false
1717
# `use_custom_libcxx = true`.
1818
enable_safe_libcxx = true
1919

20-
declare_args() {
21-
# Allows googletest to pretty-print various absl types. Disabled for nacl due
22-
# to lack of toolchain support.
23-
gtest_enable_absl_printers = true
24-
}
25-
2620
if (host_os == "mac" || is_apple) {
2721
# Needed for is_apple when targeting macOS or iOS, independent of host.
2822
# Needed for host_os=="mac" for running host tool such as gperf in blink

cast/common/BUILD.gn

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ openscreen_source_set("certificate") {
3838

3939
deps = [
4040
"../../platform",
41-
"../../third_party/abseil",
4241
"../../util",
4342
"certificate/proto:certificate_proto",
4443
]
@@ -76,7 +75,6 @@ openscreen_source_set("certificate_boringssl") {
7675

7776
deps = [
7877
":certificate",
79-
"../../third_party/abseil",
8078
"../../util",
8179
]
8280
}
@@ -111,7 +109,6 @@ openscreen_source_set("channel") {
111109
public_deps = [
112110
":public",
113111
"../../platform",
114-
"../../third_party/abseil",
115112
"../../util",
116113
"channel/proto:channel_proto",
117114
]
@@ -141,7 +138,6 @@ openscreen_source_set("public") {
141138
public_deps = [
142139
"../../discovery:public",
143140
"../../platform",
144-
"../../third_party/abseil",
145141
"../../util",
146142
]
147143
}
@@ -187,7 +183,6 @@ openscreen_source_set("test_helpers") {
187183
"../../discovery:public",
188184
"../../platform:test",
189185
"../../testing/util",
190-
"../../third_party/abseil",
191186
"../../third_party/boringssl",
192187
"../../third_party/googletest:gmock",
193188
"../../third_party/googletest:gtest",

cast/protocol/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ openscreen_source_set("unittests") {
7474
":receiver_examples",
7575
":streaming_examples",
7676
"../../platform:base",
77-
"../../third_party/abseil",
7877
"../../third_party/googletest:gmock",
7978
"../../third_party/googletest:gtest",
8079
"../../util",

cast/receiver/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ openscreen_source_set("channel") {
2525

2626
public_deps = [
2727
"../../platform",
28-
"../../third_party/abseil",
2928
"../../third_party/boringssl",
3029
"../common:channel",
3130
"../common/channel/proto:channel_proto",

cast/sender/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ openscreen_source_set("channel") {
2121
]
2222

2323
deps = [
24-
"../../third_party/abseil",
2524
"../common:channel",
2625
"../common/certificate/proto:certificate_proto",
2726
"../common/channel/proto:channel_proto",
@@ -58,7 +57,6 @@ openscreen_source_set("sender") {
5857
public_deps = [
5958
":channel",
6059
"../../platform",
61-
"../../third_party/abseil",
6260
"../../util",
6361
"../common:channel",
6462
"../common:public",

cast/standalone_sender/streaming_av1_encoder.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ class StreamingAv1Encoder : public StreamingVideoEncoder {
138138
std::mutex mutex_;
139139

140140
// Used by the encode thread to sleep until more work is available.
141-
std::condition_variable cv_; // ABSL_GUARDED_BY(mutex_)
141+
// TODO(crbug.com/322734860): implement OSP_GUARDED_BY / better mutex support.
142+
std::condition_variable cv_;
142143

143144
// These encode parameters not passed in the WorkUnit struct because it is
144145
// desirable for them to be applied as soon as possible, with the very next
145146
// WorkUnit popped from the `encode_queue_` on the encode thread, and not to
146147
// wait until some later WorkUnit is processed.
147-
bool needs_key_frame_ /* ABSL_GUARDED_BY(mutex_) */ = true;
148-
int target_bitrate_ /* ABSL_GUARDED_BY(mutex_) */ =
149-
2 << 20; // Default: 2 Mbps.
148+
bool needs_key_frame_ = true;
149+
int target_bitrate_ = 2 << 20; // Default: 2 Mbps.
150150

151151
// The queue of frame encodes. The size of this queue is implicitly bounded by
152152
// EncodeAndSend(), where it checks for the total in-flight media duration and
153153
// maybe drops a frame.
154-
std::queue<WorkUnit> encode_queue_; // ABSL_GUARDED_BY(mutex_)
154+
std::queue<WorkUnit> encode_queue_;
155155

156156
// Current AV1 encoder configuration. Most of the fields are unchanging, and
157157
// are populated in the ctor; but thereafter, only the encode thread accesses

cast/standalone_sender/streaming_vpx_encoder.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ class StreamingVpxEncoder : public StreamingVideoEncoder {
138138
std::mutex mutex_;
139139

140140
// Used by the encode thread to sleep until more work is available.
141-
std::condition_variable cv_; // ABSL_GUARDED_BY(mutex_)
141+
// TODO(crbug.com/322734860): implement OSP_GUARDED_BY / better mutex support.
142+
std::condition_variable cv_;
142143

143144
// These encode parameters not passed in the WorkUnit struct because it is
144145
// desirable for them to be applied as soon as possible, with the very next
145146
// WorkUnit popped from the `encode_queue_` on the encode thread, and not to
146147
// wait until some later WorkUnit is processed.
147-
bool needs_key_frame_ /* ABSL_GUARDED_BY(mutex_) */ = true;
148-
int target_bitrate_ /* ABSL_GUARDED_BY(mutex_) */ =
149-
2 << 20; // Default: 2 Mbps.
148+
bool needs_key_frame_ = true;
149+
int target_bitrate_ = 2 << 20; // Default: 2 Mbps.
150150

151151
// The queue of frame encodes. The size of this queue is implicitly bounded by
152152
// EncodeAndSend(), where it checks for the total in-flight media duration and
153153
// maybe drops a frame.
154-
std::queue<WorkUnit> encode_queue_; // ABSL_GUARDED_BY(mutex_)
154+
std::queue<WorkUnit> encode_queue_;
155155

156156
// Current VP8 encoder configuration. Most of the fields are unchanging, and
157157
// are populated in the ctor; but thereafter, only the encode thread accesses

0 commit comments

Comments
 (0)