[Webkit-unassigned] [Bug 26495] Upstream V8Index

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 17 21:54:52 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26495


dglazkov at chromium.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31451|review?                     |review+
               Flag|                            |




------- Comment #2 from dglazkov at chromium.org  2009-06-17 21:54 PDT -------
(From update of attachment 31451)
This whole file is total sadness. But I'd rather land it so that we have them
all in one place.

> +// FIXME: Can we use a macro to include necessary headers by using WRAPPER_TYPES?

Nah.

> +    class V8ClassIndex {
> +    public:
> +        // Type must start at non-negative numbers. See ToInt, FromInt.
> +        enum V8WrapperType {
> +            INVALID_CLASS_INDEX = 0,
> +
> +#define DEFINE_ENUM(name, type) name, 
> +            ALL_WRAPPER_TYPES(DEFINE_ENUM)
> +#undef DEFINE_ENUM
> +
> +            CLASSINDEX_END,
> +            WRAPPER_TYPE_COUNT = CLASSINDEX_END
> +        };
> +
> +        static int ToInt(V8WrapperType type) { return static_cast<int>(type); }

Add a FIXME to convert to toInt. I realize it will be near-impossible to
refactor it before all of the bindings land in one place.

> +
> +        static V8WrapperType FromInt(int v) {

Ditto.

> +            ASSERT(INVALID_CLASS_INDEX <= v && v < CLASSINDEX_END);
> +            return static_cast<V8WrapperType>(v);
> +        }
> +
> +        static FunctionTemplateFactory GetFactory(V8WrapperType type);

Ditto.

> +        // Returns a field to be used as cache for the template for the given type
> +        static v8::Persistent<v8::FunctionTemplate>* GetCache(V8WrapperType type);

Ditto.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list