Bug 83390 - Web Inspector: CodeGeneratorInspector.py: do not expose raw methods from generated types
Summary: Web Inspector: CodeGeneratorInspector.py: do not expose raw methods from gene...
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: Nobody
URL:
Keywords:
Depends on:
Blocks: 72861
  Show dependency treegraph
 
Reported: 2012-04-06 13:56 PDT by Peter Rybin
Modified: 2012-04-10 15:40 PDT (History)
10 users (show)

See Also:


Attachments
Patch (41.81 KB, patch)
2012-04-06 15:38 PDT, Peter Rybin
no flags Details | Formatted Diff | Diff
Patch (41.90 KB, patch)
2012-04-09 09:26 PDT, Peter Rybin
no flags Details | Formatted Diff | Diff
Patch (41.90 KB, patch)
2012-04-10 09:21 PDT, Peter Rybin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.