<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add event support for link preload."
href="https://bugs.webkit.org/show_bug.cgi?id=158466#c39">Comment # 39</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add event support for link preload."
href="https://bugs.webkit.org/show_bug.cgi?id=158466">bug 158466</a>
from <span class="vcard"><a class="email" href="mailto:yoav@yoav.ws" title="Yoav Weiss <yoav@yoav.ws>"> <span class="fn">Yoav Weiss</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=280799&action=diff" name="attach_280799" title="Patch">attachment 280799</a> <a href="attachment.cgi?id=280799&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=280799&action=review">https://bugs.webkit.org/attachment.cgi?id=280799&action=review</a>
<span class="quote">>> Source/WebCore/loader/LinkPreloadResourceClients.cpp:2
>> + * Copyright 2016 The Chromium Authors. All rights reserved.
>
> Did the chromium authors write this? Is there a corresponding crbug?</span >
The crbug is <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=552289">https://bugs.chromium.org/p/chromium/issues/detail?id=552289</a>
I added these files to the Chromium project a few months back. I consulted other Chromium developers for the design.
<span class="quote">>> Source/WebCore/loader/LinkPreloadResourceClients.h:28
>> +#define LinkPreloadResourceClients_h
>
> #pragma once</span >
will change
<span class="quote">>> Source/WebCore/loader/LinkPreloadResourceClients.h:81
>> + return new LinkPreloadScriptResourceClient(loader, resource);
>
> This is a memory leak. There's no corresponding delete. Instead of Optional, I think we should just use std::unique_ptr</span >
Thanks for catching this. I'll change it to use unique_ptr, and add a LinkLoader member that keeps that reference around.
<span class="quote">>> Source/WebCore/loader/cache/CachedResourceLoader.cpp:1035
>> #if !PLATFORM(IOS)
>
> I think we should consider making iOS loading work more like everything else. Probably not in this patch, though.</span >
I agree. I think we're using the OS here as a signal for network conditions, where we could most probably address those directly.
<span class="quote">>> Source/WebCore/platform/network/ResourceRequestBase.h:152
>> + void setIgnoreForRequestCounting(bool ignoreForRequestCounting) { m_ignoreForRequestCounting = ignoreForRequestCounting; }
>
> shouldIgnoreForeRequestCounting and setShouldIgnoreForRequestCounting might be better names. Or maybe ignoreForRequestCount to match CachedResource.</span >
will change to ignoreForRequestCount for better consistency.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>