Bug 59378 - WebKit2: Should be able to inspect Web Inspector in Debug Builds
Summary: WebKit2: Should be able to inspect Web Inspector in Debug Builds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brian Weinstein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-25 16:10 PDT by Brian Weinstein
Modified: 2011-04-25 16:43 PDT (History)
2 users (show)

See Also:


Attachments
[PATCH] Fix (1.72 KB, patch)
2011-04-25 16:12 PDT, Brian Weinstein
aroben: review-
Details | Formatted Diff | Diff
[PATCH] Fix v2 (1.92 KB, patch)
2011-04-25 16:36 PDT, Brian Weinstein
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Weinstein 2011-04-25 16:10:45 PDT
WebKit2: Should be able to inspect Web Inspector in Debug Builds
Comment 1 Brian Weinstein 2011-04-25 16:12:24 PDT
Created attachment 90984 [details]
[PATCH] Fix
Comment 2 Adam Roben (:aroben) 2011-04-25 16:28:10 PDT
Comment on attachment 90984 [details]
[PATCH] Fix

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

> Source/WebKit2/UIProcess/WebInspectorProxy.cpp:62
>  WebPageGroup* WebInspectorProxy::inspectorPageGroup()
>  {
> -    static WebPageGroup* pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false, false).leakRef();
> +    static WebPageGroup* pageGroup;
> +    if (pageGroup)
> +        return pageGroup;
> +
> +    pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false, false).leakRef();
> +
> +#ifndef NDEBUG
> +    // Allow developers to inspect the Web Inspector in debug builds.
> +    pageGroup->preferences()->setDeveloperExtrasEnabled(true);
> +#endif
> +
>      return pageGroup;
>  }

I think it would be clearer to add a separate createInspectorPageGroup() helper function that had all the creation code. Then this function could stay simple.
Comment 3 Brian Weinstein 2011-04-25 16:36:23 PDT
Created attachment 91011 [details]
[PATCH] Fix v2
Comment 4 Adam Roben (:aroben) 2011-04-25 16:37:46 PDT
Comment on attachment 91011 [details]
[PATCH] Fix v2

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

> Source/WebKit2/ChangeLog:9
> +        (WebKit::WebInspectorProxy::createInspectorPageGroup): Creates an inspector page group and enables

The "WebInspectorProxy::" part of this line is incorrect.

> Source/WebKit2/UIProcess/WebInspectorProxy.cpp:50
> +static WebPageGroup* createInspectorPageGroup()
> +{
> +    WebPageGroup* pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false, false).leakRef();

You should make this function return a PassRefPtr and put the leakRef at the call site.
Comment 5 Brian Weinstein 2011-04-25 16:43:22 PDT
Landed in r84841.