Adopt EnumTraits and enum class for PluginProcessType and PluginProcessSandboxPolicy.
Created attachment 401057 [details] Patch v1
Comment on attachment 401057 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=401057&action=review > Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:33 > +enum class PluginProcessType : uint8_t { How did you choose uint8_t vs. bool for this? > Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:38 > +enum class PluginProcessSandboxPolicy : uint8_t { Ditto.
Comment on attachment 401057 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=401057&action=review >> Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:33 >> +enum class PluginProcessType : uint8_t { > > How did you choose uint8_t vs. bool for this? This didn't seen like a `bool` concept, but maybe I should be thinking in terms of storage size, not whether it's a Boolean concept. I can change it if you prefer. >> Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:38 >> +enum class PluginProcessSandboxPolicy : uint8_t { > > Ditto. Ditto.
Comment on attachment 401057 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=401057&action=review >>> Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:38 >>> +enum class PluginProcessSandboxPolicy : uint8_t { >> >> Ditto. > > Ditto. If you use a boolean for storage, you don't need EnumTraits, because IPC knows there are only two valid values.
(In reply to Alex Christensen from comment #4) > Comment on attachment 401057 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401057&action=review > > >>> Source/WebKit/Shared/Plugins/PluginProcessAttributes.h:38 > >>> +enum class PluginProcessSandboxPolicy : uint8_t { > >> > >> Ditto. > > > > Ditto. > > If you use a boolean for storage, you don't need EnumTraits, because IPC > knows there are only two valid values. I'm curious whether IPC checks for 0x0 and 0x1, or just 0x0 and any value with any bit set. The latter seems less desirable to me if that's how it's implemented. (I'm not sure where to look for the implementation off the top of my head.)
This is the implementation: return !t || t == 1;
(In reply to Alex Christensen from comment #6) > This is the implementation: > return !t || t == 1; Thanks! I remembered after I posted the last comment that this was a change to Source/WTF/wtf/EnumTraits.h in Bug 190731.
Created attachment 401105 [details] Patch for landing
Comment on attachment 401105 [details] Patch for landing Marking cq+ since all bots are green except JSC, but there are no changes affecting JSC in this patch.
Committed r262598: <https://trac.webkit.org/changeset/262598> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401105 [details].
<rdar://problem/64029049>