OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int sdp_mline_index_; | 46 int sdp_mline_index_; |
47 cricket::Candidate candidate_; | 47 cricket::Candidate candidate_; |
48 | 48 |
49 RTC_DISALLOW_COPY_AND_ASSIGN(JsepIceCandidate); | 49 RTC_DISALLOW_COPY_AND_ASSIGN(JsepIceCandidate); |
50 }; | 50 }; |
51 | 51 |
52 // Implementation of IceCandidateCollection. | 52 // Implementation of IceCandidateCollection. |
53 // This implementation stores JsepIceCandidates. | 53 // This implementation stores JsepIceCandidates. |
54 class JsepCandidateCollection : public IceCandidateCollection { | 54 class JsepCandidateCollection : public IceCandidateCollection { |
55 public: | 55 public: |
| 56 JsepCandidateCollection() {} |
| 57 // Move constructor is defined so that a vector of JsepCandidateCollections |
| 58 // can be resized. |
| 59 JsepCandidateCollection(JsepCandidateCollection&& o) |
| 60 : candidates_(std::move(o.candidates_)) {} |
56 ~JsepCandidateCollection(); | 61 ~JsepCandidateCollection(); |
57 virtual size_t count() const { | 62 virtual size_t count() const { |
58 return candidates_.size(); | 63 return candidates_.size(); |
59 } | 64 } |
60 virtual bool HasCandidate(const IceCandidateInterface* candidate) const; | 65 virtual bool HasCandidate(const IceCandidateInterface* candidate) const; |
61 // Adds and takes ownership of the JsepIceCandidate. | 66 // Adds and takes ownership of the JsepIceCandidate. |
62 virtual void add(JsepIceCandidate* candidate) { | 67 virtual void add(JsepIceCandidate* candidate) { |
63 candidates_.push_back(candidate); | 68 candidates_.push_back(candidate); |
64 } | 69 } |
65 virtual const IceCandidateInterface* at(size_t index) const { | 70 virtual const IceCandidateInterface* at(size_t index) const { |
66 return candidates_[index]; | 71 return candidates_[index]; |
67 } | 72 } |
68 | 73 |
69 private: | 74 private: |
70 std::vector<JsepIceCandidate*> candidates_; | 75 std::vector<JsepIceCandidate*> candidates_; |
| 76 |
| 77 RTC_DISALLOW_COPY_AND_ASSIGN(JsepCandidateCollection); |
71 }; | 78 }; |
72 | 79 |
73 } // namespace webrtc | 80 } // namespace webrtc |
74 | 81 |
75 #endif // WEBRTC_API_JSEPICECANDIDATE_H_ | 82 #endif // WEBRTC_API_JSEPICECANDIDATE_H_ |
OLD | NEW |