Rulong Chen(陈汝龙) 65db368888 Make embedder test delegates fixture-owned
Embedder tests often install stack-local delegates, but EmbedderTest can
invoke delegate callbacks while closing the document in TearDown(). By
then, a stack delegate may already have been destroyed.

Add SetOwnedDelegate() so the fixture owns the custom delegate through
document teardown, then restores the default delegate before releasing
it. Migrate all existing call sites, remove the raw SetDelegate() API,
and store the active delegate as an UnownedPtr.

Bug: 535697671
Change-Id: I8e8da028e9c563e82d40099637c63978122077eb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/152110
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-07-24 12:15:07 -07:00
..
2026-07-06 22:01:20 -07:00