Nathan Froyd wrote:

I tried this, fixed a few compilation errors, then decided this wasn't worth it 
just yet and threw my work into a bug.  Comments appreciated:

https://bugzilla.mozilla.org/show_bug.cgi?id=1179451
  1. It's because QueryInterface has to addref, so we can't directly
     pass the returned pointer. (But otherwise it's effectively the
     same as 4.)
  2. Ugh, standard MSVC optimisation doesn't compile an nsCOMPtr in a
     ternary at all well. (If my x86_64 is up to scratch then I think
     it creates an internal flag so it remembers which arm of the
     ternary was constructed.)
  3. Why isn't the const nsCOMPtr<T>& converting to a T*? (There's too
     much indirection for my liking, so I can't work out which storage
     class is getting applied to the argument.)
  4. Maybe I'm confused, but isn't this the pattern we're trying to
     avoid so that we can remove already_AddRefed and use moves instead?

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to