Use unique_ptr in JsepCandidateCollection

Bug: None
Change-Id: I80ffacf3a355879b56a03b5cb59bffa32114dac1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147601
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28712}
This commit is contained in:
Steve Anton
2019-07-30 18:07:40 -07:00
committed by Commit Bot
parent e08ca23ec9
commit 8e967dfdfc
3 changed files with 17 additions and 26 deletions

View File

@ -16,6 +16,7 @@
#include <stddef.h>
#include <memory>
#include <string>
#include <vector>
@ -63,7 +64,6 @@ class JsepCandidateCollection : public IceCandidateCollection {
// Move constructor is defined so that a vector of JsepCandidateCollections
// can be resized.
JsepCandidateCollection(JsepCandidateCollection&& o);
~JsepCandidateCollection() override;
size_t count() const override;
bool HasCandidate(const IceCandidateInterface* candidate) const override;
// Adds and takes ownership of the JsepIceCandidate.
@ -77,7 +77,7 @@ class JsepCandidateCollection : public IceCandidateCollection {
size_t remove(const cricket::Candidate& candidate);
private:
std::vector<JsepIceCandidate*> candidates_;
std::vector<std::unique_ptr<JsepIceCandidate>> candidates_;
RTC_DISALLOW_COPY_AND_ASSIGN(JsepCandidateCollection);
};