Index: mojo/edk/system/channel_info.cc |
diff --git a/mojo/edk/system/channel_info.cc b/mojo/edk/system/channel_info.cc |
index efc5f0409161f51466b3189a9817e936ca936f6f..6d23215e905f1d60decf281a8644431ed22aeaec 100644 |
--- a/mojo/edk/system/channel_info.cc |
+++ b/mojo/edk/system/channel_info.cc |
@@ -4,6 +4,8 @@ |
#include "mojo/edk/system/channel_info.h" |
+#include <algorithm> |
+ |
namespace mojo { |
namespace system { |
@@ -19,5 +21,11 @@ ChannelInfo::ChannelInfo( |
ChannelInfo::~ChannelInfo() { |
} |
+void ChannelInfo::Swap(ChannelInfo* other) { |
+ // Note: Swapping avoids refcount churn. |
+ std::swap(channel, other->channel); |
+ std::swap(channel_thread_task_runner, other->channel_thread_task_runner); |
+} |
+ |
} // namespace system |
} // namespace mojo |