[webkit-reviews] review denied: [Bug 172393] Web Inspector: Don't create DetailsSidebarPanel classes until they are needed by a Tab : [Attachment 310733] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 22 21:58:12 PDT 2017


Joseph Pecoraro <joepeck at webkit.org> has denied Devin Rousso
<drousso at apple.com>'s request for review:
Bug 172393: Web Inspector: Don't create DetailsSidebarPanel classes until they
are needed by a Tab
https://bugs.webkit.org/show_bug.cgi?id=172393

Attachment 310733: Patch

https://bugs.webkit.org/attachment.cgi?id=310733&action=review




--- Comment #11 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 310733
  --> https://bugs.webkit.org/attachment.cgi?id=310733
Patch

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

The change seems fine, but I think it needs an iteration. I'm not sold on
Object.singleton(...) so I want to push back on that.

>>> Source/WebInspectorUI/UserInterface/Base/Utilities.js:103
>>> +Object.defineProperty(Object, "singleton",
>> 
>> This change seems unrelated to the goal stated in the change log. Is it
related?
> 
> This is used to create singleton instances of each DetailsSidebarPanel.  I
figured that it would also be nice to replace the few existing `static
instance()` methods with this for consistency.

I prefer the readability of the existing static singleton static methods. Can
you provide an argument for changing them?

> Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js:28
> +    constructor(identifier, styleClassNames, tabBarItem,
navigationSidebarPanelClass, detailsSidebarPanelClasses, disableBackForward)

I think we normally call these Constructors not Classes. Classes made me think
of classNames.

> Source/WebInspectorUI/UserInterface/Views/TabContentView.js:34
> +	   // console.assert(!detailsSidebarPanelClasses ||
detailsSidebarPanelClasses.every((detailsSidebarPanel) => detailsSidebarPanel
instanceof WebInspector.DetailsSidebarPanel));

I think you should be able to assert something here. Not instanceof, but
probably typeof x === "function".

> Source/WebInspectorUI/UserInterface/Views/TabContentView.js:181
> +    get detailsSidebarPanels()
> +    {

The user of this getter should store the result into a variable instead of
calling it many times in a loop.


More information about the webkit-reviews mailing list