[Webkit-unassigned] [Bug 77289] Web Inspector: CodeGeneratorInspector.py: reimplement generated array types
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 30 15:11:36 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=77289
--- Comment #7 from Peter Rybin <prybin at chromium.org> 2012-01-30 15:11:36 PST ---
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1580
> > +template<typename T>
> > +class ArrayItemHelper {
> > +public:
> > + typedef typename T::ItemTraits Traits;
> > +};
> Why not use T::ItemTraits directly?
This template type is a point where C++ specialization takes part. This class is only a default implementation.
I added a comment.
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1583
> > +class ArrayOf : public InspectorArray {
> We don't normally use Of in container type names, e.g. it's map or vector, not mapOf or VectorOf.
Get rid of "of"? It's cleaner? Thanks Sean! :)
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1609
> > +class StructItemTraits {
> > +public:
> just struct?
Done
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1610
> > + static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorObject> value)
> why do we need to include type into method name, i.e. why not just push()?
There is a template/specialization machinery with "T"/"RefPtr<T>" method overloading here, plus the entire code is generated. I would prefer to at least dismiss internal method overloading in favor of keeping it cleaner. So I have 2 explicitly named methods. This is not user-facing.
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1618
> > + template<typename T>
> > + static void assertCorrectValue(InspectorValue* value) {
> > + T::assertCorrectValue(value);
> > + }
> Why do we need this wrapper?
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1625
> > +class ArrayItemHelper<String> {
> > +public:
> > + class Traits {
> > + public:
> just struct?
Done
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1626
> > + static void pushRaw(InspectorArray* array, const String& value)
> just push()?
See above.
> > Source/WebCore/inspector/CodeGeneratorInspector.py:1637
> > +class ArrayItemHelper<InspectorObject> {
> > +public:
> > + class Traits {
> > + public:
> ditto
Done
> > Source/WebCore/inspector/CodeGeneratorInspector.py:2115
> > + ArrayItemHelper<T>::Traits::template assertCorrectValue<T>(array->get(i).get());
> Does this compile?
Yes. Why?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list