RESOLVED FIXED 212758
[IPC] Adopt enum class for PluginProcessType and PluginProcessSandboxPolicy
https://bugs.webkit.org/show_bug.cgi?id=212758
Summary [IPC] Adopt enum class for PluginProcessType and PluginProcessSandboxPolicy
David Kilzer (:ddkilzer)
Reported 2020-06-04 10:09:08 PDT
Adopt EnumTraits and enum class for PluginProcessType and PluginProcessSandboxPolicy.
Attachments
Patch v1 (18.77 KB, patch)
2020-06-04 11:44 PDT, David Kilzer (:ddkilzer)
darin: review+
Patch for landing (18.18 KB, patch)
2020-06-04 17:59 PDT, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2020-06-04 11:44:10 PDT
Created attachment 401057 [details] Patch v1
Darin Adler
Comment 2 2020-06-04 11:46:15 PDT
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.
David Kilzer (:ddkilzer)
Comment 3 2020-06-04 11:50:23 PDT
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.
Alex Christensen
Comment 4 2020-06-04 13:12:07 PDT
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.
David Kilzer (:ddkilzer)
Comment 5 2020-06-04 13:23:21 PDT
(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.)
Alex Christensen
Comment 6 2020-06-04 13:34:06 PDT
This is the implementation: return !t || t == 1;
David Kilzer (:ddkilzer)
Comment 7 2020-06-04 17:50:26 PDT
(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.
David Kilzer (:ddkilzer)
Comment 8 2020-06-04 17:59:58 PDT
Created attachment 401105 [details] Patch for landing
David Kilzer (:ddkilzer)
Comment 9 2020-06-04 22:30:44 PDT
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.
EWS
Comment 10 2020-06-04 22:36:37 PDT
Committed r262598: <https://trac.webkit.org/changeset/262598> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401105 [details].
David Kilzer (:ddkilzer)
Comment 11 2020-06-05 08:04:35 PDT
Note You need to log in before you can comment on or make changes to this bug.