Closed Bug 1329561 Opened 6 years ago Closed 6 years ago
Content Type is always valid
Currently, MediaContentType can be constructed from any string, so sometimes the object could be in an invalid state that could be inferred by seeing that the GetMIMEType() string was empty. It's a bit unintuitive, cumbersome, and most importantly the validity of MediaContentType objects would probably need to be tested anywhere they would be used! To help with that and lots of upcoming changes from bug 1263836, we can design MediaContentType to *always* be valid. Construction will be done through a MakeMediaContentType() function that returns a Maybe<MediaContentType>. To see the proposed patch in context: https://hg.mozilla.org/try/pushloghtml?changeset=2743aefd9eede9f207238ba71a48ccb5382af848
Comment on attachment 8824865 [details] Bug 1329561 - MediaContentType is always valid - https://reviewboard.mozilla.org/r/103172/#review103866
Attachment #8824865 - Flags: review?(jyavenard) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/c01ee23545a0 MediaContentType is always valid - r=jya
You need to log in before you can comment on or make changes to this bug.