Re: refcounting - which types to use ?

2017-08-24 Thread jyavenard
On Thursday, August 24, 2017 at 11:56:53 AM UTC+2, James Cheng wrote:
> How could I make it compile error?
> 
> I did write
> 
> RefPtr xxx = yyy;
> xxx.forget();

You need to run the static analyser.

The documentation about MOZ_MUST_USE_TYPE is explained there 
http://searchfox.org/mozilla-central/source/mfbt/Attributes.h#519-521.

This is why you should always do a try run, because the static analyser *will* 
choke on this code.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: refcounting - which types to use ?

2017-08-24 Thread jyavenard
On Thursday, August 17, 2017 at 1:02:56 PM UTC+2, Aryeh Gregor wrote:
> Note that in this case you cannot ignore the return value -- it must
> be assigned to an nsCOMPtr or a RefPtr, or else it will leak.  Ideally
> we would allow a return type of nsCOMPtr&&, but
> currently I think we don't.

This is not entirely correct.

alreadyAddRefed is marked MOZ_MUST_USE_TYPE.

If you do not use the return value, it will not compile.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Intent to implement HTMLMediaElement.srcObject partially

2015-07-15 Thread jyavenard
On Thursday, July 16, 2015 at 5:42:39 AM UTC+10, Jan-Ivar Bruaroey wrote:
 Hi,
 
 We intend to un-prefix HTMLMediaElement.srcObject (it currently exists 
 as HTMLMediaElement.mozSrcObject), even though it only supports a subset 
 of the types mandated in the spec. [1]
 
 This means it will support get/set of: MediaStream objects.
 
 This means it will throw TypeError on set of: MediaSource objects, Blob 
 objects, and File objects, for now.
 
 The intent is still to support these other types eventually. [2]
 
 The reason for doing this now is that this subset of funtionality is 
 believed to be stable, and is valuable to user-cases in WebRTC and 
 MediaCapture and Streams.
 
 Bug: https://bugzil.la/1175523
 


I need to complete bug 886194 then (that add MSE supports).

PS: We have the same first name in different language. awesome.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform