Chromium Code Reviews| Index: webrtc/p2p/base/transportcontroller.h |
| diff --git a/webrtc/p2p/base/transportcontroller.h b/webrtc/p2p/base/transportcontroller.h |
| index cdac4b6dcb5e72a08761a593b02d2f5fae9812c5..921d5508a110f0f1a87789273eaaef61fa936a98 100644 |
| --- a/webrtc/p2p/base/transportcontroller.h |
| +++ b/webrtc/p2p/base/transportcontroller.h |
| @@ -17,6 +17,7 @@ |
| #include <vector> |
| #include "webrtc/base/asyncinvoker.h" |
| +#include "webrtc/base/constructormagic.h" |
| #include "webrtc/base/sigslot.h" |
| #include "webrtc/base/sslstreamadapter.h" |
| #include "webrtc/p2p/base/candidate.h" |
| @@ -170,10 +171,21 @@ class TransportController : public sigslot::has_slots<>, |
| // TODO(deadbeef): Change the types of |dtls| and |ice| to |
| // DtlsTransportChannelWrapper and P2PTransportChannelWrapper, |
| // once TransportChannelImpl is removed. |
| - explicit RefCountedChannel(TransportChannelImpl* dtls, |
| - TransportChannelImpl* ice) |
| + RefCountedChannel(TransportChannelImpl* dtls, TransportChannelImpl* ice) |
|
honghaiz3
2016/12/13 19:02:20
Why do we implement our custom RefCounted class in
Taylor Brandstetter
2016/12/13 22:42:36
I think just because no one has bothered to change
|
| : ice_(ice), dtls_(dtls), ref_(0) {} |
| + // Move assignment operator and move constructor needed since this goes in |
| + // a vector. |
| + RefCountedChannel(RefCountedChannel&& o) |
| + : ice_(std::move(o.ice_)), dtls_(std::move(o.dtls_)), ref_(o.ref_) { |
| + } |
| + void operator=(RefCountedChannel&& o) { |
| + // Need to delete the DTLS channel first since it depends on ICE. |
|
honghaiz3
2016/12/13 19:02:20
I wonder if we can better solve the dependency by
Taylor Brandstetter
2016/12/13 22:42:36
We can discuss that separately, but I don't want t
|
| + dtls_ = std::move(o.dtls_); |
| + ice_ = std::move(o.ice_); |
| + ref_ = o.ref_; |
| + } |
| + |
| void AddRef() { ++ref_; } |
| void DecRef() { |
| ASSERT(ref_ > 0); |
| @@ -282,6 +294,8 @@ class TransportController : public sigslot::has_slots<>, |
| bool quic_ = false; |
| webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; |
| + |
| + RTC_DISALLOW_COPY_AND_ASSIGN(TransportController); |
| }; |
| } // namespace cricket |