12021-09-24 Ben Nham <nham@apple.com>
2
3 Pending preconnect key should include User-Agent
4 https://bugs.webkit.org/show_bug.cgi?id=230565
5
6 Reviewed by Chris Dumez.
7
8 When using an HTTPS proxy, the HTTP connection cache key used for connection coalescing in
9 CFNetwork includes the User-Agent (<rdar://problem/59434166>). This means we should also
10 include it in the preconnect cache key. Otherwise, we might delay the main resource load on
11 preconnect unnecessarily in cases where the User-Agent mismatches and the preconnect gets
12 thrown away. This can happen if (for instance) a page is force-loaded into desktop or mobile
13 mode on iOS, which causes a UA change after the call to decidePolicyForNavigationAction.
14
15 * NetworkProcess/NetworkLoadScheduler.cpp:
16 (WebKit::mainResourceLoadKey):
17 (WebKit::NetworkLoadScheduler::scheduleMainResourceLoad):
18 (WebKit::NetworkLoadScheduler::unscheduleMainResourceLoad):
19 (WebKit::NetworkLoadScheduler::startedPreconnectForMainResource):
20 (WebKit::NetworkLoadScheduler::finishedPreconnectForMainResource):
21 * NetworkProcess/NetworkLoadScheduler.h:
22 * NetworkProcess/NetworkProcess.cpp:
23 (WebKit::NetworkProcess::preconnectTo):
24