Skip to content

PC.local_description and friends - snapshot views or dynamic views? #2977

@alvestrand

Description

@alvestrand

In the current specification, current_local_description is described as an attribute that returns the content of the [[CurrentLocalDescription]] slot.
Returning an object in Javascript is basically passing a reference, not cloning the value.

So - in the current model, if we have:

x = pc.current_local_description
... time passes
a new candidate is added
... time passes
what is the value of x.sdp? does it include the new candidate or not?

This came up while hunting for a thread access issue inside WebRTC; it made it clear to me that life would be much simpler if those accessors returned a copy of the current state of [[LocalDescription]], and did not change after returning. But that is not the way attributes usually work.

What should we intend here?
(all the attributes of an RTCSessionDescription are readonly, so the Javascript side can't change it. The question is whether the platform can change it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions