Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify no dangling session IDs in StarboardCDM. #4554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sideb0ard
Copy link
Contributor

b/378957649

See bug for full details.

In our previous Cobalt drm_system.cc implementation we held the session update callbacks in a struct, and had to check the session hadn't been destroyed before calling the callbacks.
With the StarboardCDM implementation, those callbacks are passed from CDMSessionAdapter and are protected by being bound to a weak pointer.
I believe we don't have the same issue here and that the session usage looks correct.

@sideb0ard sideb0ard requested a review from xiaomings December 10, 2024 23:10
@@ -367,10 +367,9 @@ void StarboardCdm::OnSessionUpdated(int ticket,
} else {
promises_.RejectPromise(session_update.promise_id,
CdmPromise::Exception::INVALID_STATE_ERROR, 0,
"Unable to create CDM.");
error_message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original Cobalt implementation is to guard the case that CloseSession() is called before the OnSessionUpdateRequestGenerated() is called. The best way to verify this is to create a test web page that generates a update request then immediately close it, add an extra delay in OnSessionUpdateRequestGenerated() callback, so it called after OnSessionClosed(), and see if this is handled correctly.

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.

2 participants