Skip to content

Conversation

@SortaCookie
Copy link
Contributor

Change-Id: I797595db168fe34615aebb9a5a54873afbcfcf5c

Awallky and others added 30 commits March 31, 2025 20:01
This adds a buold flag for log prefixes. This will make it so all other
log prefixes use "chromium" while Cobalt builds use "cobalt". This is
done with the `IS_COBALT` build flag. Doing this will also make
upstreaming to Chromium simpler in the future.

BUg: b/406576115
Part of reducing Cobalt's APK size involves removing unused libraries &
classes. One set of source files includes some Variations classes that
fetch Finch seeds, which will not be necessary for Cobalt. Cobalt has
its own YT experiment framework that will not poll the Finch servers.

**Before**
```
ls -la out/android-arm_qa/apks/
total 88200
drwxr-xr-x  2 avvall primarygroup     4096 Apr  1 21:26 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  1 21:26 ..
-rw-r--r--  1 avvall primarygroup 89843716 Apr  1 21:26 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**After**
```
ls -la out/android-arm_qa/apks/
total 88188
drwxr-xr-x  2 avvall primarygroup     4096 Apr  1 22:06 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  1 22:05 ..
-rw-r--r--  1 avvall primarygroup 89832799 Apr  1 22:06 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**Delta**
10917 B or 10.9 kB

Test: Build and confirm size reduction in Cobalt.apk
Bug: b/396490329
This removes the android crash logging library, since Cobalt
on Android does not use crashpad.

Test: N/A
Bug: b/396490329
When the application is suspended, StarboardBridge clears its
ActivityHolder()
[here](https://source.corp.google.com/h/lbshell-internal/cobalt_src/+/main:cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java;l=175-177;bpv=1;bpt=0;drc=a17da04e52532e5a0480393bc751306db09e97e6).
A timing issue arises if openCobaltService () is called
[here](https://source.corp.google.com/h/lbshell-internal/cobalt_src/+/main:cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java;l=673-676;drc=a17da04e52532e5a0480393bc751306db09e97e6;bpv=1;bpt=0)
concurrently, as it may retrieve a null activity from the cleared
holder. This causes subsequent asynchronous communication from the
platform service to fail, because its callback needs a non-null activity
[here](https://source.corp.google.com/h/lbshell-internal/cobalt_src/+/main:cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java;l=100;bpv=1;bpt=0;drc=424d60be6465ceec41b2bcda7b94eaad7539dbb9)
to find the shell's webContents().

To fix this, the activity is now explicitly passed into
H5vccPlatformService and subsequently forwarded as a parameter to
StarboardBridge.openPlatformService(). This ensures the required
activity reference is available directly when needed, bypassing the
potentially null ActivityHolder and preventing the communication
failure.

b/406851603

Co-authored-by: Colin Liang <colinliang@google.com>
This removes the android crash logging library, since Cobalt on Android
does not use crashpad.

**Before (QA)**
```
ls -la out/android-arm_qa/apks/
total 88228
drwxr-xr-x  2 avvall primarygroup     4096 Apr  2 21:23 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  2 21:23 ..
-rw-r--r--  1 avvall primarygroup 89875558 Apr  2 21:23 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**After (QA)**
```
ls -la out/android-arm_qa/apks/
total 88188
drwxr-xr-x  2 avvall primarygroup     4096 Apr  1 22:06 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  1 22:05 ..
-rw-r--r--  1 avvall primarygroup 89832799 Apr  1 22:06 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**Delta (QA)**
42759 B or 42.8 kB

Test: Build and confirm size reduction in Cobalt.apk
Bug: b/396490329
…er (#5268)

Part of reducing Cobalt's APK size involves removing unused libraries &
classes. One set of source files includes some Variations classes that
fetch Finch seeds, which will not be necessary for Cobalt. Cobalt has
its own YT experiment framework that will not poll the Finch servers.

**Before**
```
ls -la out/android-arm_qa/apks/
total 88200
drwxr-xr-x  2 avvall primarygroup     4096 Apr  1 21:26 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  1 21:26 ..
-rw-r--r--  1 avvall primarygroup 89843716 Apr  1 21:26 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**After**
```
ls -la out/android-arm_qa/apks/
total 88188
drwxr-xr-x  2 avvall primarygroup     4096 Apr  1 22:06 .
drwxr-xr-x 23 avvall primarygroup    12288 Apr  1 22:05 ..
-rw-r--r--  1 avvall primarygroup 89832799 Apr  1 22:06 Cobalt.apk
-rw-r--r--  2 avvall primarygroup   442966 Apr  1 16:51 Cobalt.apk.R.txt
-rw-r--r--  1 avvall primarygroup      243 Apr  1 16:47 Trichrome.ssargs
```

**Delta**
10917 B or 10.9 kB

Test: Build and confirm size reduction in Cobalt.apk
Bug: b/396490329
Refine `DecoderBuffer::DecoderBuffer(std::unique_ptr<uint8_t[]> data, size_t size)` in case it's used (e.g. in unit tests).
    
b/374822966
git-subtree-dir: third_party/webrtc
git-subtree-split: 729f79c176c8b4c3a8c1b60f39df5fb43323b27b
Import webrtc as squashed subtree from DEPS

b/409532571
Disables Mozilla NSS ( Network Security Services ) certificate access.
This is used on desktop Linux configs, and works through a
runtime-loaded loaded dynamic libraries - this is not viable or
necessary in Chrobalt.
We use Chromium built-in root store instead.

b/389146680
b/409573470
This adds a build flag for log prefixes. This will make it so all other
log prefixes use "chromium" while Cobalt builds use "cobalt". This is
done with the `IS_COBALT` build flag. Doing this will also make
upstreaming to Chromium simpler in the future.

Bug: b/406576115
1. Add buffer type to DecoderBuffer allocator and
DecoderBuffer::Allocator::Allocate(), so we may using different buffer
pools for different types of buffers in future to reduce fragmentation.
2. Add DecoderBufferAllocatorTest to verify against different allocation
settings of DecoderBufferAllocator.
3. Improve allocation logging in DecoderBufferAllocator with extra
information for using in the above unit tests.
4. Improve ReuseAllocatorBase::PrintAllocations() with extra information
e.g. allocation percentage.
5. Add allocation_extractor.py to extra allocation operations from a
full log to be used in the above unit tests.

b/369245553
Refactor StarboardRenderer with StarboardRendererTraits without
functional changes. This prepares to pass arguments like
|GetCommandBufferStub| in GpuMojoMediaClient, which cannot transfer the
ownership and shared with all StarboardRenderer for decode-to-texture
mode (youtube/cobalt#5158).

b/409597740
b/375070492
b/392683875

Add client side Finch initialization to Cobalt and enable Hang Watcher
feature.
Still fails to link cobalt, but gets through all compile steps.

b/408431835
Reset |state_| to STATE_FLUSHED after pending flushes. Otherwise, this
will cause a wrong |state_| when StarboardRenderer::StartPlayingFrom.

b/409370497
johnxwork and others added 20 commits April 17, 2025 14:30
1. Add a new class DecoderBufferAllocator::Strategy to manage the
allocation strategy, and leave the DecoderBufferAllocator to manage
other details like logging, or destroying the strategy when it's empty.
This allows us to experiment different allocation strategies in future.
2. Clean up the code a bit by removing some unused logic (e.g. the ones
regarding max capacity).
3. Refined DecoderBufferAllocatorTests to allow better comparison of
different configs.

b/399430536
b/402243381

Fix errors while linking cobalt.
Pepper API is not intended to be supported by Cobalt
Change-Id: Ieb977a9869fb491f4e746e2628933767998efda0
Change-Id: Ia5b7e2ca3adddc7e1bb7037e06353a584aa13adf
Change-Id: I56bf17b89e410351d093e8293886d31aa7124fb4
Change-Id: I82018cf3db0e0abc7fd82f5aa2c127a06a9b14af
…we want.

Change-Id: I98d84ff26e279414329b3fcca7de9c41464d414b
Change-Id: I985412293256008e9cc92e1d9e03873c435e0c80
Change-Id: I1bd61d09e3322f666d96e8cb037f2b9f234e5ceb
Change-Id: Idb3dbd5750b3f5c90fd0b09f5f6d5951d50fe828
Change-Id: I2c82676e54ea6454e7a89f178c3a7be7371cf8fe
Change-Id: I2f7eb2708f989de171fd17f1e45acb147d856a1e
Change-Id: I6edf21aa989cb216e1847b394d86ff54cc43ea28
Change-Id: Icc886ec6068bb275576e0aac556537ae4f2b47bc
Change-Id: I78ad45d9367f26af696daa0808243bc593e1d800
correctly being checked by GHA.

Change-Id: I9c3421f53cf405fe0e1d10d0062320638839f2d8
…ing gclient sync

Change-Id: I4b5c5a60ada77aba00eeade86b73e68b08a6e53e
@SortaCookie SortaCookie force-pushed the experimental/gsync-caching branch from de0957a to c12393a Compare April 24, 2025 21:44
@SortaCookie SortaCookie requested review from a team as code owners April 24, 2025 21:44
@SortaCookie SortaCookie requested review from y4vor and removed request for a team April 24, 2025 21:44
Change-Id: I797595db168fe34615aebb9a5a54873afbcfcf5c
@SortaCookie SortaCookie force-pushed the experimental/gsync-caching branch 2 times, most recently from fd4f5e0 to dfc8f56 Compare April 24, 2025 22:02
…hing

Change-Id: Id4bfe32d0ac56041c8d0485abf90d85e1834d500
@SortaCookie SortaCookie force-pushed the experimental/gsync-caching branch from dfc8f56 to c7ec738 Compare April 24, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.