Bug 62810 - Web Inspector: Network panel does not show main resource content for iframes deleted from the document
Summary: Web Inspector: Network panel does not show main resource content for iframes ...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 13:26 PDT by Vsevolod Vlasov
Modified: 2011-06-17 13:00 PDT (History)
14 users (show)

See Also:


Attachments
patch (34.62 KB, patch)
2011-06-16 13:33 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
patch with build fixes + comments addressed (35.78 KB, patch)
2011-06-17 03:24 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
build fixes (35.78 KB, patch)
2011-06-17 05:18 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2011-06-16 13:26:14 PDT
Network panel does not show main resource content for iframes deleted from the document.

chromium bug: https://code.google.com/p/chromium/issues/detail?id=82899

The following change includes InspectorPageAgent refactoring exposing some of the content decoding methods to InspectorResourceAgent.
Note that this refactoring will be needed for fixing bugs related to loading the same url in different context (e.g. loading the same url as an image and as a stylesheet).
Comment 1 Vsevolod Vlasov 2011-06-16 13:33:01 PDT
Created attachment 97484 [details]
patch
Comment 2 Collabora GTK+ EWS bot 2011-06-16 14:01:04 PDT
Comment on attachment 97484 [details]
patch

Attachment 97484 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/8874304
Comment 3 Alexander Pavlov (apavlov) 2011-06-17 02:32:04 PDT
Comment on attachment 97484 [details]
patch

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

The resource buffer extraction changes look sane in general.

> Source/WebCore/inspector/InspectorPageAgent.cpp:156
> +    return InspectorPageAgent::sharedBufferContent(buffer, textEncodingName, withBase64Encode, result);

optional: You might go without the class qualification here and below. Do we have a determined rule for this in the guidelines?

> Source/WebCore/inspector/InspectorPageAgent.cpp:159
> +bool InspectorPageAgent::sharedBufferContent(PassRefPtr<SharedBuffer> buffer, const String& textEncodingName, bool withBase64Encode, String* result)

For static members, we add the "// static" comment on the preceding line

> Source/WebCore/inspector/InspectorPageAgent.cpp:174
> +void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame, const KURL& url, bool base64Encode, String* result)

Please add // static above - I must have missed it.
Comment 4 Pavel Feldman 2011-06-17 02:58:29 PDT
Comment on attachment 97484 [details]
patch

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

> LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html:12
> +    iframe.addEventListener('load', iframeLoaded);

iframe.onload = iframeLoaded;

> LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html:18
> +    iframe.removeEventListener('load', iframeLoaded);

No need to remove the listener.
Comment 5 Vsevolod Vlasov 2011-06-17 03:24:45 PDT
Created attachment 97572 [details]
patch with build fixes + comments addressed
Comment 6 Vsevolod Vlasov 2011-06-17 03:26:32 PDT
(In reply to comment #3)
> (From update of attachment 97484 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=97484&action=review
> 
> The resource buffer extraction changes look sane in general.
> 
> > Source/WebCore/inspector/InspectorPageAgent.cpp:156
> > +    return InspectorPageAgent::sharedBufferContent(buffer, textEncodingName, withBase64Encode, result);
> 
> optional: You might go without the class qualification here and below. Do we have a determined rule for this in the guidelines?

According to what I see in MainResourceLoader I removed class qualification for InspectorPageAgent::resourceContent() call. This one, however, is called from file static method, so class qualification could not be omitted.
Comment 7 Gustavo Noronha (kov) 2011-06-17 03:46:44 PDT
Comment on attachment 97572 [details]
patch with build fixes + comments addressed

Attachment 97572 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/8876564
Comment 8 Vsevolod Vlasov 2011-06-17 05:18:20 PDT
Created attachment 97586 [details]
build fixes
Comment 9 Pavel Feldman 2011-06-17 05:56:38 PDT
Comment on attachment 97586 [details]
build fixes

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

> Source/WebCore/inspector/InspectorPageAgent.cpp:160
> +bool InspectorPageAgent::sharedBufferContent(PassRefPtr<SharedBuffer> buffer, const String& textEncodingName, bool withBase64Encode, String* result)

Consider renaming to non-getter name (fetchSharedBufferConnect).

> Source/WebCore/inspector/NetworkResourcesData.h:72
> +        InspectorPageAgent::ResourceType type() const { return m_type; }

I'd try not to increase the amount of network->page dependencies. Can we keep them separate?
Comment 10 WebKit Review Bot 2011-06-17 13:00:45 PDT
Comment on attachment 97586 [details]
build fixes

Clearing flags on attachment: 97586

Committed r89163: <http://trac.webkit.org/changeset/89163>
Comment 11 WebKit Review Bot 2011-06-17 13:00:50 PDT
All reviewed patches have been landed.  Closing bug.