Closed Bug 1213738 Opened 9 years ago Closed 9 years ago

LambdaRunnable should move lambda instead of copying it

Categories

(Core :: WebRTC, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: mozbugz, Assigned: jib)

References

Details

(Whiteboard: [CID 1307876])

Attachments

(2 files)

From Coverity:

** CID 1307876:  Performance inefficiencies  (PASS_BY_VALUE)
/obj-x86_64-unknown-linux-gnu/dist/include/mozilla/media/MediaUtils.h: 222 in mozilla::media::NewTaskFrom<mozilla::MediaManager::SelectSettings(mozilla::dom::MediaStreamConstraints &, nsRefPtr<mozilla::media::Refcountable<mozilla::ScopedDeletePtr<nsTArray<nsRefPtr<mozilla::MediaDevice>>>>> &)::[lambda() (instance 1)]>(T1)()


________________________________________________________________________________________________________
*** CID 1307876:  Performance inefficiencies  (PASS_BY_VALUE)
/obj-x86_64-unknown-linux-gnu/dist/include/mozilla/media/MediaUtils.h: 222 in mozilla::media::NewTaskFrom<mozilla::MediaManager::SelectSettings(mozilla::dom::MediaStreamConstraints &, nsRefPtr<mozilla::media::Refcountable<mozilla::ScopedDeletePtr<nsTArray<nsRefPtr<mozilla::MediaDevice>>>>> &)::[lambda() (instance 1)]>(T1)()
216       }
217       OnRunType mOnRun;
218     };
219     
220     template<typename OnRunType>
221     LambdaTask<OnRunType>*
   CID 1307876:  Performance inefficiencies  (PASS_BY_VALUE)
   Passing parameter aOnRun of type "mozilla::MediaManager::SelectSettings(mozilla::dom::MediaStreamConstraints &, nsRefPtr<mozilla::media::Refcountable<mozilla::ScopedDeletePtr<nsTArray<nsRefPtr<mozilla::MediaDevice> > > > > &)::[lambda() (instance 1)]" (size 936 bytes) by value.
222     NewTaskFrom(OnRunType aOnRun)
223     {
224       return new LambdaTask<OnRunType>(aOnRun);
225     }
226     
227     /* media::CoatCheck - There and back again. Park an object in exchange for an id.
Rank: 45
Priority: -- → P4
backlog: --- → webrtc/webaudio+
Bug 1213738 - media::NewRunnableFrom() and media::NewTaskFrom() move lambda arg instead of copying it.
Attachment #8672852 - Flags: review?(rjesup)
Assignee: nobody → jib
Comment on attachment 8672852 [details]
MozReview Request: Bug 1213738 - media::NewRunnableFrom() and media::NewTaskFrom() move lambda arg instead of copying it.

https://reviewboard.mozilla.org/r/21801/#review19573
Attachment #8672852 - Flags: review?(rjesup) → review+
FYI the intermittent build-fail on OS X 10.7 debug seems to be on inbound.
Keywords: checkin-needed
Bug 1213738 - media::Pledge.Then() moves lambda args instead of copying them.
Attachment #8673251 - Flags: review?(rjesup)
I forgot I should update the other lambda-using function in that file as well.
Attachment #8673251 - Flags: review?(rjesup) → review+
Comment on attachment 8673251 [details]
MozReview Request: Bug 1213738 - media::Pledge.Then() moves lambda args instead of copying them.

https://reviewboard.mozilla.org/r/21873/#review19653
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: