Bug 147830 - Cover memory cache subresource validation policy with cache tests
Summary: Cover memory cache subresource validation policy with cache tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-08-10 10:38 PDT by Antti Koivisto
Modified: 2016-06-06 12:46 PDT (History)
3 users (show)

See Also:


Attachments
patch (81.31 KB, patch)
2015-08-13 08:27 PDT, Antti Koivisto
ap: review+
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2015-08-10 10:38:01 PDT
Existing disk-cache tests currently cover disk and XHR memory cache validation behaviors. They can be extended to cover regular subresource policy too.
Comment 1 Antti Koivisto 2015-08-13 08:27:30 PDT
Created attachment 258891 [details]
patch
Comment 2 Alexey Proskuryakov 2015-08-13 08:45:20 PDT
Comment on attachment 258891 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258891&action=review

Nice!

> Source/WebCore/loader/FrameLoader.h:288
> +    void setStrictRawResourceValidationPolicyDisabledForTesting(bool b) { m_isStrictRawResourceValidationPolicyDisabledForTesting = b; }

I'd use a real word instead of "b" here.

> Source/WebCore/loader/FrameLoader.h:289
> +    bool isStrictRawResourceValidationPolicyDisabledForTesting() { return m_isStrictRawResourceValidationPolicyDisabledForTesting; }

strictRawResourceValidationPolicyIsDisabledForTesting would result in better grammar in conditional constructs.

> Source/WebCore/loader/cache/CachedResourceLoader.cpp:699
> +    // FIXME: We should have same cache policy for all resource types.

It is good to add a FIXME here. It would be even more helpful to explain why.

> Source/WebCore/loader/cache/CachedResourceLoader.cpp:701
> +        bool strictPolicyDisabled = frame()->loader().isStrictRawResourceValidationPolicyDisabledForTesting();

When we use frame() elsewhere in this function, it's passed down to logMemoryCacheResourceRequest, which has a null check.

It seems that frame can't be null, yet I wanted to call your attention to the fact that the patch adds what looks like the first unchecked use of frame in this function.
Comment 3 Antti Koivisto 2015-08-14 07:09:53 PDT
https://trac.webkit.org/r188468
Comment 4 David Kilzer (:ddkilzer) 2016-06-06 12:46:15 PDT
<rdar://problem/11740403>