Bug 90153 - Web Inspector: [Regression] Resource content is not loaded if Resource.requestContent method is called before network request is finished.
Summary: Web Inspector: [Regression] Resource content is not loaded if Resource.reques...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 03:36 PDT by Vsevolod Vlasov
Modified: 2012-06-29 02:35 PDT (History)
10 users (show)

See Also:


Attachments
Patch (12.65 KB, patch)
2012-06-28 05:34 PDT, Vsevolod Vlasov
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2012-06-28 03:36:24 PDT
Steps to reproduce:
1) Open webkit.org
2) open main.css in Sources Panel
3) reload several times, try pressing ctrl+r several times very often

Sometimes (quite often) main.css is shown in sources panel without any content.

This is happening since Resource-NetworkRequest split because Resource.requestContent does not check that associated request was already loaded.

Patch to follow.
Comment 1 Vsevolod Vlasov 2012-06-28 05:34:10 PDT
Created attachment 149932 [details]
Patch
Comment 2 Yury Semikhatsky 2012-06-29 01:43:35 PDT
Comment on attachment 149932 [details]
Patch

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

> LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html:27
> +          contentWasRequested = true;

No need to set it second time

> LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html:38
> +          if (contentWasLoaded)

Page reload reply should always come before _addRequest unless you receive _addRequest for the page that was not reloaded yet. Probably using a synchronously loaded resources would allow to avoid this non-determinism.
Comment 3 Vsevolod Vlasov 2012-06-29 02:15:23 PDT
Regression introduced in r114116
Comment 4 Vsevolod Vlasov 2012-06-29 02:33:14 PDT
Committed r121537: <http://trac.webkit.org/changeset/121537>
Comment 5 Vsevolod Vlasov 2012-06-29 02:35:39 PDT
(In reply to comment #2)
> (From update of attachment 149932 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=149932&action=review
> 
> > LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html:27
> > +          contentWasRequested = true;
> 
> No need to set it second time
Done.

> > LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html:38
> > +          if (contentWasLoaded)
> 
> Page reload reply should always come before _addRequest unless you receive _addRequest for the page that was not reloaded yet. Probably using a synchronously loaded resources would allow to avoid this non-determinism.
It turned out I didn't need all this page reloaded events, landed without listening to them.