Bug 69351 - Web Inspector: make ResourceView(s) compile
Summary: Web Inspector: make ResourceView(s) compile
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: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 10:40 PDT by Pavel Feldman
Modified: 2011-10-05 04:59 PDT (History)
11 users (show)

See Also:


Attachments
Patch (11.68 KB, patch)
2011-10-04 10:44 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
[Patch] More ResourceViews. (27.10 KB, patch)
2011-10-04 11:14 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-10-04 10:40:54 PDT
Patch to follow.
Comment 1 Pavel Feldman 2011-10-04 10:44:25 PDT
Created attachment 109645 [details]
Patch
Comment 2 Pavel Feldman 2011-10-04 11:14:17 PDT
Created attachment 109655 [details]
[Patch] More ResourceViews.
Comment 3 Yury Semikhatsky 2011-10-05 01:56:18 PDT
Comment on attachment 109655 [details]
[Patch] More ResourceViews.

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

> Source/WebCore/inspector/front-end/ResourceHeadersView.js:328
> +        if (typeof headersLength === "number") {

Extract all this block into a separate method and call it explicitly where needed instead of doing this odd check here.
Comment 4 Pavel Feldman 2011-10-05 02:20:01 PDT
Comment on attachment 109655 [details]
[Patch] More ResourceViews.

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

>> Source/WebCore/inspector/front-end/ResourceHeadersView.js:328

> 
> Extract all this block into a separate method and call it explicitly where needed instead of doing this odd check here.

This method has 6 fields and 6 refresh methods that update corresponding fields. I would not want to split one of them into two parts for the following reasons:
- Call site might get confused on whether it should call both methods of only one
- This is a classical render(title, opt_subtitle). Not sure why call site should have two methods for this case
- Imagine title owning subtitle element, how would you allow title to position (define location of) subtitle element
Comment 5 Pavel Feldman 2011-10-05 03:00:17 PDT
> Extract all this block into a separate method and call it explicitly where needed instead of doing this odd check here.

Does this mean that the change suggested in required in order to let this patch in?
Comment 6 Yury Semikhatsky 2011-10-05 03:01:12 PDT
(In reply to comment #4)
> (From update of attachment 109655 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109655&action=review
> 
> >> Source/WebCore/inspector/front-end/ResourceHeadersView.js:328
> 
> > 
> > Extract all this block into a separate method and call it explicitly where needed instead of doing this odd check here.
> 
> This method has 6 fields and 6 refresh methods that update corresponding fields. I would not want to split one of them into two parts for the following reasons:
> - Call site might get confused on whether it should call both methods of only one
Method name should eliminate such confusion.

> - This is a classical render(title, opt_subtitle). Not sure why call site should have two methods for this case
Because it is a different than a public method on TreeElement or such in that it is a private method which is called from two places: at first with 3 params, at second 2 params and because of that you have to an id block to the method which could well be avoided.

> - Imagine title owning subtitle element, how would you allow title to position (define location of) subtitle element
Extract title creation into a separate method that would return a container where to insert the subtitle?
Comment 7 Yury Semikhatsky 2011-10-05 03:06:01 PDT
(In reply to comment #5)
> > Extract all this block into a separate method and call it explicitly where needed instead of doing this odd check here.
> 
> Does this mean that the change suggested in required in order to let this patch in?

Although it would make the inspector code more clear, I wouldn't block this patch  if you have a principal disagreement on this change.
Comment 8 Pavel Feldman 2011-10-05 04:59:47 PDT
Landed as http://svn.webkit.org/repository/webkit/trunk@96695