Bug 108628

Summary: Added TriState to WTF and started using it in one place
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, benjamin, darin, fpizlo, mifenton, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bdakin: review+

Geoffrey Garen
Reported 2013-02-01 06:12:49 PST
Added TriState to WTF and started using it in one place
Attachments
Patch (11.61 KB, patch)
2013-02-01 06:17 PST, Geoffrey Garen
bdakin: review+
Geoffrey Garen
Comment 1 2013-02-01 06:17:22 PST
Geoffrey Garen
Comment 2 2013-02-01 07:02:59 PST
Mark Lam
Comment 3 2013-02-01 10:09:17 PST
Comment on attachment 186030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186030&action=review > Source/WTF/wtf/TriState.h:35 > +}; If you use the new EnumClass.h, you can make this: ENUM_CLASS_BEGIN(TriState) { False, True, Mixed } ENUM_CLASS_END(TriState); And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration.
Benjamin Poulain
Comment 4 2013-02-01 13:33:30 PST
Comment on attachment 186030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186030&action=review > Source/WTF/WTF.xcodeproj/project.pbxproj:-313 > FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; > - FE43302716A7ADC300D1585D /* TypeSafeEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = FE43302616A7ADC300D1585D /* TypeSafeEnum.h */; }; Why are you removing the TypeSafeEnum? > Source/WTF/WTF.xcodeproj/project.pbxproj:1264 > A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, > + 149EF16316BBFE0D000A4331 /* TriState.h in Headers */, Build section unsorted :( >> Source/WTF/wtf/TriState.h:35 >> +enum TriState { >> + FalseTriState, >> + TrueTriState, >> + MixedTriState >> +}; > > If you use the new EnumClass.h, you can make this: > > ENUM_CLASS_BEGIN(TriState) { > False, > True, > Mixed > } ENUM_CLASS_END(TriState); > > And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration. Instead of an enum, I wonder if this would not benefit from a class with the logic function explicitly defined? If you plan to use the TriState in logic operations, it would be beneficial to define and, or and not.
Note You need to log in before you can comment on or make changes to this bug.