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 support for workers #206

Merged
merged 7 commits into from
Oct 19, 2020
Merged

Add support for workers #206

merged 7 commits into from
Oct 19, 2020

Conversation

clelland
Copy link
Contributor

@clelland clelland commented Apr 17, 2020

This adds support for configuring reporting in worker scripts, and for
generating reports from a worker context. Initialization of reporting endpoints
is decoupled from fetch so that it can be referenced in HTML instead, when
documents and workers are created.


Preview | Diff

This adds support for configuring reporting in worker scripts, and for
generating reports from a worker context. Initialization of reporting endpoints
is decoupled from fetch so that it can be referenced in HTML instead, when
documents and workers are created.
@clelland
Copy link
Contributor Author

@bakulf, FYI
Also, this change should be in conjunction with whatwg/html#5470, which handles timing of initializing the reporting endpoints in both documents and workers.

index.src.html Outdated Show resolved Hide resolved
This move endpoint and report lists, as well as registered reporting
observers to the relevant WindowOrWorkerGlobalScope.
index.src.html Outdated Show resolved Hide resolved
index.src.html Outdated

Each <a>document</a> has an <dfn for="document" export attribute>reports</dfn>
list, which is a list of <a>reports</a>.
To <dfn export>initialize a document or worker's endpoint list</dfn>, given a
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "initialize a global's endpoint list" perhaps?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming the idea is to patch HTML to run this algorithm on global object creation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's in progress in whatwg/html#5470

Copy link
Contributor

Choose a reason for hiding this comment

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

Ping on

Should this be "initialize a global's endpoint list" perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be "initialize a global's endpoint list" perhaps?

I missed that one; that's a better name 👍

index.src.html Outdated Show resolved Hide resolved
index.src.html Outdated Show resolved Hide resolved
index.src.html Outdated
1. Let |environment| be the <a spec=ecmascript lt=realm>ECMAScript global
environment</a> associated with the <a>context object</a>.
1. Let |global| be the <a spec=ecmascript>global object</a> of the <a
spec=ecmascript>realm</a> associated with the <a>context object</a>.
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be Let |global| be the [=relevant global object=] of [=this=]. (Although perhaps you should keep using "context object" for consistency for now, instead of "this".)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. (Will switch to [=this=] soon)

index.src.html Outdated Show resolved Hide resolved
index.src.html Outdated
environment</a> associated with |observer|.
4. If the size of |observer|'s <a>report queue</a> is 1:
1. Let |global| be the <a spec=ecmascript>global object</a> of the <a
spec=ecmascript>realm</a> associated with |observer|.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

index.src.html Show resolved Hide resolved
Copy link
Contributor

@domenic domenic left a comment

Choose a reason for hiding this comment

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

LGTM modulo algorithm naming

index.src.html Outdated

Each <a>document</a> has an <dfn for="document" export attribute>reports</dfn>
list, which is a list of <a>reports</a>.
To <dfn export>initialize a document or worker's endpoint list</dfn>, given a
Copy link
Contributor

Choose a reason for hiding this comment

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

Ping on

Should this be "initialize a global's endpoint list" perhaps?

@clelland clelland merged commit 7733a9c into master Oct 19, 2020
@clelland clelland deleted the workers branch October 19, 2020 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants