@@ -3022,6 +3022,78 @@ details of reused connections are not exposed and time values are coarsened.
30223022</div>
30233023
30243024
3025+ <h3 id=preemptive-connection-operations>Preemptive connection operations</h3>
3026+
3027+ <div algorithm="preemmptively-obtain-a-connection">
3028+ <p> To <dfn export>preemptively obtain a connection</dfn> , given an
3029+ <a>environment settings object</a> <var> environment</var> , a <a for=/>URL</a> <var> url</var> , and a
3030+ boolean <var> credentials</var> , run these steps:
3031+
3032+ <ol>
3033+ <li><p> Let <var> key</var> be the result of <a for=/>determining the network partition key</a> given
3034+ <var> environment</var> .
3035+
3036+ <li>
3037+ <p> <a>Check CSP for preemptive operation</a> with <var> environment</var> and <var> url</var> . If
3038+ that returns <b> allowed</b> , <a>Obtain a connection</a> with <var> key</var> , <var> url</var> and
3039+ <var> credentials</var> .
3040+
3041+ <p class=note> This connection is obtained but not used directly. It will remain in the
3042+ <a>connection pool</a> for subsequent use.
3043+
3044+ <p class=note> The user agent should attempt to initiate a preconnect and perform the full
3045+ connection handshake (DNS+TCP for HTTP, and DNS+TCP+TLS for HTTPS origins) whenever possible, but
3046+ is allowed to elect to perform a partial handshake (DNS only for HTTP, and DNS or DNS+TCP for
3047+ HTTPS origins), or skip it entirely, due to resource constraints or other reasons.</p>
3048+
3049+ <p class=note> The optimal number of connections per origin is dependent on the negotiated
3050+ protocol, users current connectivity profile, available device resources, global connection
3051+ limits, and other context specific variables. As a result, the decision for how many connections
3052+ should be opened is deferred to the user agent.</p>
3053+ </ol>
3054+ </div>
3055+
3056+ <div algorithm="preemmptively-resolve-an-origin">
3057+ <p> To <dfn export>preemptively resolve an origin</dfn> , given an
3058+ <a>environment settings object</a> <var> environment</var> and a <a for=/>URL</a> <var> url</var> , run
3059+ these steps:
3060+
3061+ <ol>
3062+ <li><p> Let <var> key</var> be the result of <a for=/>determining the network partition key</a> given
3063+ <var> environment</var> .
3064+
3065+ <li><p> <a>Check CSP for preemptive operation</a> with <var> environment</var> and <var> url</var> . If
3066+ that returns <b> blocked</b> , return.
3067+
3068+ <li><p> Let <var> proxies</var> be the result of finding proxies for <var> url</var> in an
3069+ <a>implementation-defined</a> manner.
3070+
3071+ <li>
3072+ <p> If there <var> proxies</var> is <a for=list>empty</a> , or if <var> proxies</var>
3073+ <a for=list>contains</a> "<code> DIRECT</code> ", then <a>resolve an origin</a> given <var> key</var>
3074+ and <var> url</var> 's <a for=url>origin</a> .
3075+
3076+ <p class=note> As the results of this algorithm can be cached, future fetches could be faster.
3077+ </ol>
3078+ </div>
3079+
3080+ <div algorithm="check-preemptive-operation-csp">
3081+ <p> To <dfn>Check CSP for preemptive operation</dfn> , given an
3082+ <a>environment settings object</a> <var> environment</var> , and a <a for=/>URL</a> <var> url</var> ,
3083+ run these steps:
3084+
3085+ <ol>
3086+ <li><p> Let <var> request</var> be a <a for=/>request</a> whose <a for=request>URL</a> is
3087+ <var> url</var> , <a for=request>initiator</a> is "<code> prefetch</code> ", and whose
3088+ <a for=request>client</a> is <var> environment</var> .
3089+
3090+ <li><p> Return the result of running <a>should request be blocked by Content Security Policy?</a>
3091+ given <var> request</var> .
3092+
3093+ </ol>
3094+ </div>
3095+
3096+
30253097<h3 id=network-partition-keys>Network partition keys</h3>
30263098
30273099<p> A <dfn>network partition key</dfn> is a tuple consisting of a <a for=/>site</a> and null or
@@ -8688,7 +8760,7 @@ to discuss. [[CSP]]
86888760<a>environment settings object</a> you're operating in. Web-exposed APIs are generally defined with
86898761Web IDL, for which every object that implements an <a>interface</a> has a
86908762<a>relevant settings object</a> you can use. For example, a <a for=/>request</a> associated with an
8691- <a for=/>element</a> would set the <a for=/>request</a> 's <a for=request>client</a> to the element' s
8763+ {{Element}} would set the <a for=/>request</a> 's <a for=request>client</a> to the element' s
86928764<a>node document</a> 's <a>relevant settings object</a> . All features that are directly web-exposed
86938765by JavaScript, HTML, CSS, or other {{Document}} subresources should have a
86948766<a for=request>client</a> .
0 commit comments