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

Add steps to createOffer and explicitly specify what is queued #745

Merged
merged 5 commits into from
Aug 25, 2016

Conversation

adam-be
Copy link
Member

@adam-be adam-be commented Aug 17, 2016

Fixes #744

This PR is currently based on PR #721 to make use of some changes to the generic queued operation section.

@adam-be
Copy link
Member Author

adam-be commented Aug 19, 2016

Rebased passed PR #721 so this PR should be easier to review now. @jan-ivar, can you please have a look?

<li>
<p>If <var>connection</var>'s [[<a>isClosed</a>]] slot
is <code>true</code>, return a promise rejected with an
<code>InvalidStateError</code>.</p>
Copy link
Member

Choose a reason for hiding this comment

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

Move the isClosed test up so it is not enqueued. We want to return an already rejected promise to JS on input and state validation (so they're immediately observable as rejected in JS debuggers, like we did for mediacapture). We suppress rejections past close.

Copy link
Member

Choose a reason for hiding this comment

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

I mean we suppress rejections from enqueued actions past close.

Copy link
Member Author

Choose a reason for hiding this comment

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

This text is in line with the queued steps of addIceCandidate, but I think what you're saying makes sense. So we check for closed state right away, and then make sure that nothing is taken of the queue if the isClosed slot is true.

@jan-ivar
Copy link
Member

Lgtm once isClosed check is moved out.

@adam-be
Copy link
Member Author

adam-be commented Aug 22, 2016

I've moved the rejection of closed state into the sync part of the queueing steps so it can be reused by all queued operations. I've also added checks into the queuing algorithm that checks if the isClosed flag is set before advancing (e.g. taking the next operation off the queue). @jan-ivar, please review (especially the third commit).

<p>Reject <var>p</var> with a
<code>DOMException</code> object whose
<code>name</code> attribute has the value
<code>OperationError</code> and, abort these
Copy link
Member

Choose a reason for hiding this comment

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

Comma in wrong place, though I just noticed this isn't an if-statement, and there are no more steps, so can we simply remove ", and abort these steps?"

@jan-ivar
Copy link
Member

Lgtm with nits.

produce an identity assertion, reject
<var>p</var> with a <code>DOMException</code>
object whose <code>name</code> attribute has
the value <code>NotReadableError</code>, and
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to get more information about what went wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. We might want to create a separate issue on that.

@adam-be
Copy link
Member Author

adam-be commented Aug 23, 2016

Thanks @jan-ivar and @fluffy for reviewing

@adam-be adam-be force-pushed the explicit-queueing-create-offer branch from 387784b to 0ffe6a2 Compare August 23, 2016 09:41
@adam-be
Copy link
Member Author

adam-be commented Aug 23, 2016

Rebased on top of commit that patches the JSEP reference system. Also updated a JSEP reference that previously wasn't working. I think this is ready to be merged now.

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.

None yet

4 participants