Closed
Bug 1318228
Opened 9 years ago
Closed 9 years ago
NewRunnable storage default should be StoreCopyPassByConstLRef
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla53
| Tracking | Status | |
|---|---|---|
| firefox53 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
When doing something like `NewRunnableMethod<T>`, the default storage for most types is StoreCopyPassByValue:
http://searchfox.org/mozilla-central/rev/efcb1644e49c36445e75d89b434fdf4c84832c84/xpcom/glue/nsThreadUtils.h#740
That is, we keep a copy of the T object in the runnable (good), but then we actually give another copy to the runnable function every time it is run, which seems quite expensive!
Instead we should default to StoreCopyPassByConstLRef, which give a const-reference of the runnable copy.
From there, the function could itself make a copy if it wanted to.
(Thanks to Nathan for reminding me about this.)
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gsquelart
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 4•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8811912 [details]
Bug 1318228 - Replace nsAutoPtr with UniquePtr in GMPCDMProxy -
https://reviewboard.mozilla.org/r/93814/#review93972
Attachment #8811912 -
Flags: review?(cpearce) → review+
Comment 5•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8811912 [details]
Bug 1318228 - Replace nsAutoPtr with UniquePtr in GMPCDMProxy -
https://reviewboard.mozilla.org/r/93814/#review93974
::: dom/media/gmp/GMPCDMProxy.h:122
(Diff revision 1)
> friend class gmp_InitDoneCallback;
> friend class gmp_InitGetGMPDecryptorCallback;
>
> struct InitData {
> uint32_t mPromiseId;
> nsString mOrigin;
In the commit message:
s/GMPCMDProxy/GMPCDMProxy/
I make this typo all the time.
Comment 6•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8811913 [details]
Bug 1318228 - Replace nsAutoPtr with UniquePtr in MediaDrmCDMProxy -
https://reviewboard.mozilla.org/r/93816/#review93976
Attachment #8811913 -
Flags: review?(cpearce) → review+
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 9•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8811911 [details]
Bug 1318228 - NewRunnable defaults to StoreCopyPassByConstLRef -
https://reviewboard.mozilla.org/r/93812/#review94326
This ought to be totally safe.
Attachment #8811911 -
Flags: review?(nfroyd) → review+
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 13•9 years ago
|
||
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b01174ea634
NewRunnable defaults to StoreCopyPassByConstLRef - r=froydnj
https://hg.mozilla.org/integration/autoland/rev/ace53fd3af96
Replace nsAutoPtr with UniquePtr in GMPCDMProxy - r=cpearce
https://hg.mozilla.org/integration/autoland/rev/8b9935e92099
Replace nsAutoPtr with UniquePtr in MediaDrmCDMProxy - r=cpearce
Comment 14•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4b01174ea634
https://hg.mozilla.org/mozilla-central/rev/ace53fd3af96
https://hg.mozilla.org/mozilla-central/rev/8b9935e92099
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•