[Webkit-unassigned] [Bug 136297] New: Web Replay: code generator should be able to encode/decode ViewState::Flags

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 27 11:04:48 PDT 2014


           Summary: Web Replay: code generator should be able to
                    encode/decode ViewState::Flags
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: burg at cs.washington.edu
                CC: joepeck at webkit.org
            Blocks: 129694,136290

ViewState::(enum) is an anonymous enum inside of a struct (ViewState). ViewState::Flags is a typedef for uint32_t, and the enum values are used to bitwise-construct and query a uint32_t containing several flags.

For replay we still want to serialize ViewState with string names, since ViewState::Flags could change in the future and we don't want reordering the flags to break serialization.
But, since the enum is un-named and ViewState::Flags is a uint32_t, the existing code will try to define new EncodingTraits specializations for uint32_t, which isn't allowed.

To sidestep this, I'll generate a wrapper class for each framework, so multiple specializations can exist for the same underlying type. Cases like ViewState will use a new flag in the inputs file to opt-in to this code generation behavior.


enum class JSEnum { FooBar, BarBaz };

template <JSEnum EnumName, typename StorageType>
class UncheckedJSEnum {
    UncheckedJSEnum(StorageType value) : m_value(value) { }
    StorageType m_value;

template<> struct EncodingTraits<UncheckedJSEnum<JSEnum::FooBar,uint32_t>> {

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