Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ Finally, several other Web properties with large codebases have expressed intere

## API Overview

Before developers can make use of the profiler, they'll first have to signal to the UA that they wish to profile by exposing the `Document-Policy: js-profiling` header.

> This header ensures that any UA-specific profiling overhead is incurred only on loads that may profile.

Developers will then be able to spin up a new `profiler` via `new Profiler(options)`, where `options` contains the following required fields:
Developers can start a new profiler with `new Profiler(options)`, where `options` contains the following required fields:

- `sampleInterval`: Target sample rate (in ms per sample)
- The UA may choose a different sample rate than the one that the user requested (which must be the next lowest valid sampling interval).
Expand Down
17 changes: 0 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ <h2><dfn data-lt="constructor()">new Profiler(options)</dfn></h2>
<a>new Profiler(options)</a> runs the following steps given an object <var>options</var> of type <a>ProfilerInitOptions</a>:
<ol>
<li>If <var>options</var>' {{ProfilerInitOptions/sampleInterval}} is less than 0, throw a <code>RangeError</code>.</li>
<li><a href="https://w3c.github.io/webappsec-permissions-policy/document-policy.html#algo-get-policy-value">Get the policy value</a> for <code>"js-profiling"</code> in the <a data-cite="!HTML5#document">Document</a>. If the result is false, throw a <code>"NotAllowedError"</code> DOMException.</li>
<li>Create a new <a>profiling session</a> where:</li>
<ol>
<li>The associated <a>sample interval</a> is set to either <a>ProfilerInitOptions.sampleInterval</a> OR the next lowest interval supported by the UA.</li>
Expand Down Expand Up @@ -356,22 +355,6 @@ <h2>The <dfn>ProfilerInitOptions</dfn> dictionary</h2>
<li><dfn>maxBufferSize</dfn> is the desired <a>sample buffer size limit</a>, in samples.</li>
</ul>
</section>
<section id="document-policy">
<h2>Document Policy</h2>
<p>
This spec defines a <a href="https://w3c.github.io/webappsec-permissions-policy/document-policy.html#configuration-point">configuration point</a> in <a href="https://w3c.github.io/webappsec-permissions-policy/document-policy.html">Document Policy</a> with name <code>js-profiling</code>. Its <a href="https://w3c.github.io/webappsec-permissions-policy/document-policy.html#configuration-point-type">type</a> is <code>boolean</code> with <a href="https://w3c.github.io/webappsec-permissions-policy/document-policy.html#configuration-point-default-value">default value</a> <code>false</code>.
</p>
<p class="note">
Document policy is leveraged to give UAs the ability to avoid storing
required metadata for profiling when the document does not explicitly
request it. While this metadata could conceivably be generated in
response to a profiler being started, we store this bit on the document
in order to signal to the engine as early as possible (as profiling early
in page load is a common use case). This overhead may be non-trivial
depending on the implementation, and therefore we default to
<code>false</code>.
</p>
</section>
<section>
<h2>Automation</h2>
<p>
Expand Down