Closed
Bug 1251714
Opened 9 years ago
Closed 9 years ago
use UniquePtr instead of ScopedDeletePtr in media/
Categories
(Core :: WebRTC, defect, P2)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
backlog | webrtc/webaudio+ |
People
(Reporter: froydnj, Assigned: froydnj)
References
Details
Attachments
(1 file, 1 obsolete file)
56.67 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
UniquePtr is more standard than ScopedDeletePtr; using standard
constructs whenever possible is preferable.
This patch merits a couple explanations:
- Where it made sense, I tried to convert:
T* foo() {
UniquePtr<T> x = ...;
...
return x.release();
}
into:
UniquePtr<T> foo()
with corresponding changes inside |foo|'s body.
- The attentive reader will note that:
auto x = MakeUnique<T>(...);
is used sometimes and:
UniquePtr<T> x(new T(...));
is used sometimes. I would prefer to use the former, but was stymied
in several places due to protected constructors. (MakeUnique doesn't
have access to those protected constructors, natch.)
![]() |
Assignee | |
Comment 1•9 years ago
|
||
Attachment #8724179 -
Flags: review?(rjesup)
![]() |
Assignee | |
Comment 2•9 years ago
|
||
Update with some other patches I had lying about to fix new/free mismatch
issues.
Attachment #8724800 -
Flags: review?(rjesup)
![]() |
Assignee | |
Updated•9 years ago
|
Attachment #8724179 -
Attachment is obsolete: true
Attachment #8724179 -
Flags: review?(rjesup)
Comment 3•9 years ago
|
||
Comment on attachment 8724800 [details] [diff] [review]
use UniquePtr instead of ScopedDeletePtr in media/
Review of attachment 8724800 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/mtransport/transportflow.cpp
@@ +34,5 @@
> // is maintained, it shouldn't be possible to access and
> // destroy it simultaneously. The conversion to an nsAutoPtr
> // ensures automatic destruction of the queue at exit of
> // DestroyFinal.
> + nsAutoPtr<std::deque<TransportLayer*> > layers_tmp(layers_.release());
Since you're touching it, "> >" -> ">>"
::: media/mtransport/transportflow.h
@@ +134,5 @@
> static void ClearLayers(std::queue<TransportLayer *>* layers);
>
> std::string id_;
> TransportLayer::State state_;
> + UniquePtr<std::deque<TransportLayer *> > layers_;
ditto
::: media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ +512,5 @@
> return;
> }
>
> // Make a copy rather than cast away constness
> + auto inner_data = MakeUnique<unsigned char[]>(len);
I presume this does the correct delete []
Attachment #8724800 -
Flags: review?(rjesup) → review+
Updated•9 years ago
|
backlog: --- → webrtc/webaudio+
Rank: 25
Priority: -- → P2
This and bug 1251715 are backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/7e80b936414e for gtest crashes in media code: https://treeherder.mozilla.org/logviewer.html#?job_id=22754484&repo=mozilla-inbound
Flags: needinfo?(nfroyd)
![]() |
Assignee | |
Comment 9•9 years ago
|
||
(In reply to Pulsebot from comment #8)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/181f18c5d1ad
I fixed the gtest issues by not using static UniquePtr instances; apparently some of the tests don't shut things down properly. =/
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5a7c710ff0a6
Comment 10•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•