Bug 99736 - Refactor CachedResourceLoader: add CachedResourceRequest
Summary: Refactor CachedResourceLoader: add CachedResourceRequest
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Marja Hölttä
URL:
Keywords:
Depends on:
Blocks: 101300
  Show dependency treegraph
 
Reported: 2012-10-18 10:59 PDT by Marja Hölttä
Modified: 2012-11-05 22:24 PST (History)
21 users (show)

See Also:


Attachments
Patch (41.22 KB, patch)
2012-10-18 12:29 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (45.25 KB, patch)
2012-10-18 18:15 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (51.10 KB, patch)
2012-10-19 11:58 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (51.92 KB, patch)
2012-10-19 13:01 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (52.77 KB, patch)
2012-10-19 14:54 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (59.09 KB, patch)
2012-10-19 16:52 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (59.16 KB, patch)
2012-10-19 17:05 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.34 KB, patch)
2012-10-19 18:51 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.34 KB, patch)
2012-10-19 18:54 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.34 KB, patch)
2012-10-19 19:10 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.35 KB, patch)
2012-10-20 15:44 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.38 KB, patch)
2012-10-20 17:39 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (62.04 KB, patch)
2012-10-21 11:39 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff
Patch (58.75 KB, patch)
2012-10-21 11:41 PDT, Marja Hölttä
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marja Hölttä 2012-10-18 10:59:26 PDT
For fixing bug 84883 and bug 92761, we need to keep track on which Element (or css / xhr) requests a resource.

For this, CachedResourceLoader::requestXYZ functions will be refactored so that they take a CachedResourceRequest as a parameter, instead of taking a long list of parameters.

Next steps: a new patch for bug 92761 will add an Element* to CachedResourceRequest (and create the CachedResourceRequest in a place where the Element* is known).
Comment 1 Marja Hölttä 2012-10-18 12:29:18 PDT
Created attachment 169450 [details]
Patch
Comment 2 jochen 2012-10-18 12:36:33 PDT
Comment on attachment 169450 [details]
Patch

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

> Source/WebCore/loader/cache/CachedResourceLoader.h:72
> +    class CachedResourceRequest {

what's the reason for making this a sub class? Why not even put it into a separate file?
Comment 3 Build Bot 2012-10-18 13:00:09 PDT
Comment on attachment 169450 [details]
Patch

Attachment 169450 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14459139

New failing tests:
compositing/layers-inside-overflow-scroll.html
animations/animation-direction-normal.html
animations/3d/matrix-transform-type-animation.html
canvas/philip/tests/2d.clearRect.clip.html
animations/additive-transform-animations.html
canvas/philip/tests/2d.clearRect.zero.html
canvas/philip/tests/2d.clearRect.globalalpha.html
accessibility/accessibility-node-reparent.html
canvas/philip/tests/2d.clearRect.globalcomposite.html
animations/animation-border-overflow.html
animations/animation-direction-alternate-reverse.html
accessibility/accessibility-object-detached.html
canvas/philip/tests/2d.canvas.readonly.html
compositing/animation/computed-style-during-delay.html
compositing/geometry/clipped-video-controller.html
animations/3d/transform-perspective.html
canvas/philip/tests/2d.clearRect.transform.html
canvas/philip/tests/2d.clearRect.negative.html
compositing/animation/animated-composited-inside-hidden.html
canvas/philip/tests/2d.clearRect.path.html
canvas/philip/tests/2d.canvas.reference.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html
canvas/philip/tests/2d.clearRect.basic.html
accessibility/accessibility-node-memory-management.html
animations/animation-css-rule-types.html
canvas/philip/tests/2d.clearRect.shadow.html
accessibility/adjacent-continuations-cause-assertion-failure.html
canvas/philip/tests/2d.clearRect+fillRect.basic.html
canvas/philip/tests/2d.clearRect.nonfinite.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.html
Comment 4 Adam Barth 2012-10-18 15:48:32 PDT
Comment on attachment 169450 [details]
Patch

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

This looks great.  Some comments below.  Also, it looks like your patch is causing a large number of test failures.

> Source/WebCore/ChangeLog:8
> +        This is needed for fixing bugs 84883 and 92761.

Please add more information to the ChangeLog that explains why we're making this change.

>> Source/WebCore/loader/cache/CachedResourceLoader.h:72
>> +    class CachedResourceRequest {
> 
> what's the reason for making this a sub class? Why not even put it into a separate file?

Yeah, we should put it in a separate CachedResourceRequest.h and in the WebCore namespace directly.

> Source/WebCore/loader/cache/CachedResourceLoader.h:82
> +        ResourceRequest& resourceRequest() { return m_resourceRequest; }

resourceRequest -> mutableResourceRequest to emphasize that this is a non-const reference.

> Source/WebCore/loader/cache/CachedResourceLoader.h:89
> +    private:

Please add a blank line above this line.
Comment 5 Adam Barth 2012-10-18 15:49:12 PDT
Your patch is also failing a number of Chromium unit tests:

AssociatedURLLoaderTest.*
Comment 6 Alexey Proskuryakov 2012-10-18 15:57:57 PDT
> For fixing bug 84883 and bug 92761, we need to keep track on which Element (or css / xhr) requests a resource.

This rationale seems conceptually weak, at least on the surface. What if multiple elements request the same resource, for example? Or if a preload is started before any element is created?
Comment 7 Alexey Proskuryakov 2012-10-18 15:58:35 PDT
(I'm not objecting against this change per se, FWIW)
Comment 8 Adam Barth 2012-10-18 16:07:50 PDT
> This rationale seems conceptually weak, at least on the surface. What if multiple elements request the same resource, for example? Or if a preload is started before any element is created?

That's the problem that we're hoping to solve with CachedResourceRequest.  Each of the requesters will have a separate CachedResourceRequest so we can sensibly disentangle their separate requests from the single response they all get back.
Comment 9 James Simonsen 2012-10-18 16:16:31 PDT
(In reply to comment #6)
> > For fixing bug 84883 and bug 92761, we need to keep track on which Element (or css / xhr) requests a resource.
> 
> This rationale seems conceptually weak, at least on the surface. What if multiple elements request the same resource, for example? Or if a preload is started before any element is created?

For 84883, these cases are tightly defined:

1. The first element wins.

2. We don't need the actual element, just its name and document.
Comment 10 Marja Hölttä 2012-10-18 18:15:46 PDT
Created attachment 169525 [details]
Patch
Comment 11 Marja Hölttä 2012-10-18 18:17:42 PDT
Thanks for comments; the new patch addresses them, and also fixes the chromium unit tests (hopefully the mac tests too).
Comment 12 Gyuyoung Kim 2012-10-18 18:24:24 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14465211
Comment 13 Early Warning System Bot 2012-10-18 18:25:06 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14464223
Comment 14 WebKit Review Bot 2012-10-18 18:26:10 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14463231
Comment 15 Early Warning System Bot 2012-10-18 18:27:16 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14469044
Comment 16 Peter Beverloo (cr-android ews) 2012-10-18 18:31:41 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/14424739
Comment 17 Build Bot 2012-10-18 19:45:19 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14412832
Comment 18 Build Bot 2012-10-19 04:55:19 PDT
Comment on attachment 169525 [details]
Patch

Attachment 169525 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14461413
Comment 19 Marja Hölttä 2012-10-19 11:58:31 PDT
Created attachment 169668 [details]
Patch
Comment 20 Build Bot 2012-10-19 12:33:27 PDT
Comment on attachment 169668 [details]
Patch

Attachment 169668 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14455641
Comment 21 Build Bot 2012-10-19 12:46:44 PDT
Comment on attachment 169668 [details]
Patch

Attachment 169668 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14466525
Comment 22 Marja Hölttä 2012-10-19 13:01:06 PDT
Created attachment 169679 [details]
Patch
Comment 23 Marja Hölttä 2012-10-19 14:54:42 PDT
Created attachment 169698 [details]
Patch
Comment 24 Build Bot 2012-10-19 15:02:25 PDT
Comment on attachment 169698 [details]
Patch

Attachment 169698 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14455685
Comment 25 Build Bot 2012-10-19 15:14:12 PDT
Comment on attachment 169698 [details]
Patch

Attachment 169698 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14462607
Comment 26 Early Warning System Bot 2012-10-19 15:38:06 PDT
Comment on attachment 169698 [details]
Patch

Attachment 169698 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14455698
Comment 27 Early Warning System Bot 2012-10-19 16:13:22 PDT
Comment on attachment 169698 [details]
Patch

Attachment 169698 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14469417
Comment 28 Gyuyoung Kim 2012-10-19 16:14:34 PDT
Comment on attachment 169698 [details]
Patch

Attachment 169698 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14473152
Comment 29 Marja Hölttä 2012-10-19 16:52:50 PDT
Created attachment 169726 [details]
Patch
Comment 30 Marja Hölttä 2012-10-19 17:05:11 PDT
Created attachment 169730 [details]
Patch
Comment 31 Build Bot 2012-10-19 17:20:34 PDT
Comment on attachment 169730 [details]
Patch

Attachment 169730 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14465670
Comment 32 Marja Hölttä 2012-10-19 18:51:14 PDT
Created attachment 169740 [details]
Patch
Comment 33 Marja Hölttä 2012-10-19 18:54:19 PDT
Created attachment 169741 [details]
Patch
Comment 34 Build Bot 2012-10-19 18:58:48 PDT
Comment on attachment 169741 [details]
Patch

Attachment 169741 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14465692
Comment 35 Marja Hölttä 2012-10-19 19:10:49 PDT
Created attachment 169744 [details]
Patch
Comment 36 Adam Barth 2012-10-19 23:44:51 PDT
Comment on attachment 169744 [details]
Patch

Marking r- so the EWS will stop spinning.
Comment 37 Marja Hölttä 2012-10-20 15:44:01 PDT
Created attachment 169776 [details]
Patch
Comment 38 Marja Hölttä 2012-10-20 17:14:42 PDT
Comment on attachment 169776 [details]
Patch

(still doesn't pass tests)
Comment 39 Marja Hölttä 2012-10-20 17:39:12 PDT
Created attachment 169777 [details]
Patch
Comment 40 Marja Hölttä 2012-10-21 11:39:35 PDT
Created attachment 169809 [details]
Patch
Comment 41 Marja Hölttä 2012-10-21 11:41:25 PDT
Created attachment 169810 [details]
Patch
Comment 42 Adam Barth 2012-10-21 15:17:35 PDT
Green bubbles!
Comment 43 Adam Barth 2012-10-21 15:23:37 PDT
Comment on attachment 169810 [details]
Patch

Thanks.  This looks like a good step.

Please give ap a chance to comment before landing the patch.
Comment 44 Marja Hölttä 2012-10-22 16:21:21 PDT
Comment on attachment 169810 [details]
Patch

IRCed with ap, he says: "The idea of the patch seems good to me regardless of the goal, we do need a class that encapsulates a request with web-pertinent knowledge. I won't have any time soon to deeply review, so this makes it an ack :)"
Comment 45 Adam Barth 2012-10-22 16:24:45 PDT
Comment on attachment 169810 [details]
Patch

SGTM.  Thanks for closing the loop with ap.
Comment 46 WebKit Review Bot 2012-10-22 16:35:39 PDT
Comment on attachment 169810 [details]
Patch

Clearing flags on attachment: 169810

Committed r132157: <http://trac.webkit.org/changeset/132157>
Comment 47 WebKit Review Bot 2012-10-22 16:35:48 PDT
All reviewed patches have been landed.  Closing bug.