Open Bug 1300511 Opened 5 years ago Updated 4 years ago

[meta] Replace union OptionalType usages with Maybe<Type> in ipdls

Categories

(Core :: IPC, defect, P3)

defect

Tracking

()

People

(Reporter: kanru, Unassigned)

References

Details

Currently some IPDL headers define optional type of Type as

  union OptionalType {
    void_t;
    Type;
  };

or

  union OptionalType {
    null_t;
    Type;
  };

I intend to replace these with

  using Maybe<Type> from "mozilla/Maybe.h"

and use Maybe<Type> directly in IPDL methods. The rationale is it is clearer how to check the nullness of Maybe<T> and we don't need to define extra optional types in ipdl. This could also avoid uninitialized optional types (it will be OptionalType::T__None, I think it's very confusing)

Maybe we can also make the IPDL parser output a warning or error when such usage is detected.
Depends on: 1300512
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.