Bug 83390

Summary: Web Inspector: CodeGeneratorInspector.py: do not expose raw methods from generated types
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, pfeldman, pmuellr, rik, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 72861    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Peter Rybin 2012-04-06 13:56:08 PDT
Generated types in InspectorTypeBuilder are public inherited from InspectorObject and InspectorArray. This opens all raw methods to any client.
The generated types should be inherited from intermediate types instead (private inheritance cannot be used because RefPtf won't work with it).
Comment 1 Peter Rybin 2012-04-06 15:38:07 PDT
Created attachment 136075 [details]
Patch
Comment 2 WebKit Review Bot 2012-04-06 16:26:13 PDT
Attachment 136075 [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/InspectorValues.cpp:668:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorValues.cpp:763:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yury Semikhatsky 2012-04-09 05:34:20 PDT
Comment on attachment 136075 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        protected. InspectorObject and InspectorArray are reimplemented by "public Morozov" pattern.

This pattern doesn't seem to be used outside of post-Soviet countries, could you rephrase it?

> Source/WebCore/inspector/InspectorValues.cpp:671
> +    *output = reinterpret_cast<InspectorObject*>(this);

Why not static_cast as in other places?

> Source/WebCore/inspector/InspectorValues.cpp:683
> +    return reinterpret_cast<InspectorObject*>(this);

Same here and below.
Comment 4 Peter Rybin 2012-04-09 09:26:43 PDT
Created attachment 136237 [details]
Patch
Comment 5 Peter Rybin 2012-04-09 09:27:34 PDT
> > Source/WebCore/ChangeLog:9
> > +        protected. InspectorObject and InspectorArray are reimplemented by "public Morozov" pattern.
> 
> This pattern doesn't seem to be used outside of post-Soviet countries, could you rephrase it?

Done

> > Source/WebCore/inspector/InspectorValues.cpp:671
> > +    *output = reinterpret_cast<InspectorObject*>(this);
> Why not static_cast as in other places?

Done

> > Source/WebCore/inspector/InspectorValues.cpp:683
> > +    return reinterpret_cast<InspectorObject*>(this);
> Same here and below.

Done
Comment 6 WebKit Review Bot 2012-04-09 09:33:18 PDT
Attachment 136237 [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/InspectorValues.cpp:668:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorValues.cpp:763:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Peter Rybin 2012-04-10 09:21:05 PDT
Created attachment 136468 [details]
Patch
Comment 8 WebKit Review Bot 2012-04-10 09:23:15 PDT
Attachment 136468 [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/InspectorValues.cpp:668:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorValues.cpp:763:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 WebKit Review Bot 2012-04-10 15:39:56 PDT
Comment on attachment 136468 [details]
Patch

Clearing flags on attachment: 136468

Committed r113783: <http://trac.webkit.org/changeset/113783>
Comment 10 WebKit Review Bot 2012-04-10 15:40:03 PDT
All reviewed patches have been landed.  Closing bug.