@@ -2909,37 +2909,6 @@ reused across <a>connections</a> whose <a for=connection>credentials</a> are fal
2909
2909
<a>connections</a> whose <a for=connection>credentials</a> are true.
2910
2910
</div>
2911
2911
2912
- <div algorithm="preemmptively-obtain-a-connection">
2913
- <p> To <dfn export>preemptively obtain a connection</dfn> , given an
2914
- <a>environment settings object</a> <var> environment</var> , a <a for=/>URL</a> <var> url</var> , and a
2915
- boolean <var> credentials</var> , run these steps:
2916
-
2917
- <ol>
2918
- <li><p> Let <var> key</var> be the result of <a for=/>determining the network partition key</a> given
2919
- <var> environment</var> .
2920
-
2921
- <li><p> <a>Check resource hint CSP</a> with <var> environment</var> and <var> url</var> . If that
2922
- returns <b> allowed</b> , <a>Obtain a connection</a> with <var> key</var> , <var> url</var> and
2923
- <var> credentials</var> .
2924
- </ol>
2925
- </div>
2926
-
2927
- <div algorithm="check-resource-hint-csp">
2928
- <p> To <dfn export>Check resource hint CSP</dfn> , given an
2929
- <a>environment settings object</a> <var> environment</var> , and a <a for=/>URL</a> <var> url</var> ,
2930
- run these steps:
2931
-
2932
- <ol>
2933
- <li><p> Let <var> request</var> be a <a for=/>request</a> whose <a for=request>URL</a> is
2934
- <var> url</var> , <a for=request>initiator</a> is "<code> prefetch</code> ", and whose
2935
- <a for=request>client</a> is <var> environment</var> .
2936
-
2937
- <li><p> Return the result of running <a>should request be blocked by Content Security Policy?</a>
2938
- given <var> request</var> .
2939
-
2940
- </ol>
2941
- </div>
2942
-
2943
2912
<hr>
2944
2913
2945
2914
<div algorithm>
@@ -3053,6 +3022,78 @@ details of reused connections are not exposed and time values are coarsened.
3053
3022
</div>
3054
3023
3055
3024
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
+
3056
3097
<h3 id=network-partition-keys>Network partition keys</h3>
3057
3098
3058
3099
<p> A <dfn>network partition key</dfn> is a tuple consisting of a <a for=/>site</a> and null or
@@ -8719,7 +8760,7 @@ to discuss. [[CSP]]
8719
8760
<a>environment settings object</a> you're operating in. Web-exposed APIs are generally defined with
8720
8761
Web IDL, for which every object that implements an <a>interface</a> has a
8721
8762
<a>relevant settings object</a> you can use. For example, a <a for=/>request</a> associated with an
8722
- <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
8723
8764
<a>node document</a> 's <a>relevant settings object</a> . All features that are directly web-exposed
8724
8765
by JavaScript, HTML, CSS, or other {{Document}} subresources should have a
8725
8766
<a for=request>client</a> .
0 commit comments