Bug 80789

Summary: Web Inspector: TypeBuilder: Introduce OptOutput class for optional output parameters
Product: WebKit Reporter: Peter Rybin <prybin>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, ossy, pfeldman, pmuellr, prybin, rik, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 81090    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Only merge. Do not commit before 81132 none

Description Peter Rybin 2012-03-11 09:21:50 PDT
Currently there is not proper support for optional output parameters.
It only works with RefPtr-based types (they can contain null values) and with boolean type (false is incorrectly treated as "not set" value).

A dedicated OptOutput class should be provided to support all types values plus "not set" state.
Comment 1 Peter Rybin 2012-03-11 14:24:52 PDT
Created attachment 131257 [details]
Patch
Comment 2 WebKit Review Bot 2012-03-11 14:27:52 PDT
Attachment 131257 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/inspector/InjectedScript.cpp:65:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:75:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:85:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:261:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:108:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yury Semikhatsky 2012-03-12 03:00:53 PDT
Comment on attachment 131257 [details]
Patch

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

> Source/WebCore/inspector/CodeGeneratorInspector.py:2244
> +class OptOutput {

Please make this class non-copyable to avoid passing it by value.

> Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp:67
> +static const InspectorFrontend::Debugger::Reason::Enum domNativeBreakpointType = InspectorFrontend::Debugger::Reason::DOM;

Is there a reason for not inlining the new constant values?

> Source/WebCore/inspector/InspectorPageAgent.cpp:508
> +        *cookiesString = "";

The protocol description says it should contain result of document.cookies even if the cookies array is present. Please file a bug on this and put FIXME here.

> Source/WebCore/inspector/InspectorPageAgent.cpp:839
> +    frameObject->setSecurityOrigin(frame->document()->securityOrigin()->toString());

Should this parameter be required if it is always present anyway? The type is still hidden anyway so I think we may want to fix this.
Comment 4 Peter Rybin 2012-03-12 11:08:13 PDT
> > Source/WebCore/inspector/CodeGeneratorInspector.py:2244
> > +class OptOutput {

> Please make this class non-copyable to avoid passing it by value.

Done

> > Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp:67
> > +static const InspectorFrontend::Debugger::Reason::Enum domNativeBreakpointType = InspectorFrontend::Debugger::Reason::DOM;

> Is there a reason for not inlining the new constant values?

Done

> > Source/WebCore/inspector/InspectorPageAgent.cpp:508
> > +        *cookiesString = "";
> 
> The protocol description says it should contain result of document.cookies even if the cookies array is present. Please file a bug on this and put FIXME here.

Done

> > Source/WebCore/inspector/InspectorPageAgent.cpp:839
> > +    frameObject->setSecurityOrigin(frame->document()->securityOrigin()->toString());
> 
> Should this parameter be required if it is always present anyway? The type is still hidden anyway so I think we may want to fix this.

Done
Comment 5 Peter Rybin 2012-03-12 11:10:37 PDT
Created attachment 131354 [details]
Patch
Comment 6 WebKit Review Bot 2012-03-12 11:12:35 PDT
Attachment 131354 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/inspector/InjectedScript.cpp:65:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:75:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:85:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:261:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:108:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Build Bot 2012-03-12 22:19:33 PDT
Comment on attachment 131354 [details]
Patch

Attachment 131354 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/11945302
Comment 8 Yury Semikhatsky 2012-03-13 00:38:50 PDT
Comment on attachment 131354 [details]
Patch

The change appears to break Windows build, r- for this. Please fix.
Comment 9 Yury Semikhatsky 2012-03-13 00:39:13 PDT
(In reply to comment #8)
> (From update of attachment 131354 [details])
> The change appears to break Windows build, r- for this. Please fix.

4>Generating Code...
4>c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\inspectorbackenddispatcher.cpp(827) : error C2220: warning treated as error - no 'object' file generated
4>c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\inspectorbackenddispatcher.cpp(827) : warning C4701: potentially uninitialized local variable 'out_base64Encoded' used
4>c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\inspectorbackenddispatcher.cpp(3039) : warning C4701: potentially uninitialized local variable 'out_result' used
4>c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\inspectorbackenddispatcher.cpp(3060) : warning C4701: potentially uninitialized local variable 'out_result' used
4>c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\inspectorbackenddispatcher.cpp(3354) : warning C4701: potentially uninitialized local variable 'out_result' used
Comment 10 Peter Rybin 2012-03-13 16:11:43 PDT
Created attachment 131740 [details]
Patch
Comment 11 WebKit Review Bot 2012-03-13 16:16:20 PDT
Attachment 131740 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/inspector/InjectedScript.cpp:65:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:75:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:85:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:261:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:108:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 WebKit Review Bot 2012-03-14 01:04:37 PDT
Comment on attachment 131740 [details]
Patch

Clearing flags on attachment: 131740

Committed r110673: <http://trac.webkit.org/changeset/110673>
Comment 13 WebKit Review Bot 2012-03-14 01:04:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Csaba Osztrogonác 2012-03-14 01:45:16 PDT
Reopen, because it broke the Qt minimal bot, I think all !ENABLE(INSPECTOR) build.
Comment 15 Yury Semikhatsky 2012-03-14 02:03:40 PDT
From the IRC channel:
<Ossy>: yurys,  benjaminp said:" for the Inspector build, it looks like ContentSearchUtils.h needs #if ENABLE(INSPECTOR)"
Comment 16 Peter Rybin 2012-03-14 17:42:45 PDT
Created attachment 131963 [details]
Only merge. Do not commit before 81132
Comment 17 WebKit Review Bot 2012-03-14 17:45:48 PDT
Attachment 131963 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/inspector/InjectedScript.cpp:65:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:75:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:85:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.cpp:261:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:108:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Yury Semikhatsky 2012-03-16 07:43:44 PDT
Comment on attachment 131963 [details]
Only merge. Do not commit before 81132

Clearing flags on attachment: 131963

Committed r111005: <http://trac.webkit.org/changeset/111005>
Comment 19 Yury Semikhatsky 2012-03-16 07:44:08 PDT
All reviewed patches have been landed.  Closing bug.