Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 channel_ref_ = other.channel_ref_; | 39 channel_ref_ = other.channel_ref_; |
| 40 ++channel_ref_->ref_count; | 40 ++channel_ref_->ref_count; |
| 41 | 41 |
| 42 return *this; | 42 return *this; |
| 43 } | 43 } |
| 44 | 44 |
| 45 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) | 45 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) |
| 46 : channel(channel), ref_count(1) {} | 46 : channel(channel), ref_count(1) {} |
| 47 | 47 |
| 48 ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) | 48 ChannelManager::ChannelManager(uint32_t instance_id, |
| 49 const Config& config, | |
| 50 RtcEventLog* const event_log) | |
| 49 : instance_id_(instance_id), | 51 : instance_id_(instance_id), |
| 50 last_channel_id_(-1), | 52 last_channel_id_(-1), |
| 51 lock_(CriticalSectionWrapper::CreateCriticalSection()), | 53 lock_(CriticalSectionWrapper::CreateCriticalSection()), |
| 52 config_(config) {} | 54 config_(config), |
| 55 event_log_(event_log) { | |
| 56 } | |
| 53 | 57 |
| 54 ChannelOwner ChannelManager::CreateChannel() { | 58 ChannelOwner ChannelManager::CreateChannel() { |
| 55 return CreateChannelInternal(config_); | 59 return CreateChannelInternal(config_, event_log_); |
| 56 } | 60 } |
| 57 | 61 |
| 58 ChannelOwner ChannelManager::CreateChannel(const Config& external_config) { | 62 ChannelOwner ChannelManager::CreateChannel(const Config& external_config, |
| 59 return CreateChannelInternal(external_config); | 63 RtcEventLog* const event_log) { |
|
Henrik Grunell WebRTC
2015/08/12 12:43:45
Will we ever use another event log than the one gi
ivoc
2015/08/12 13:16:41
That is certainly an option, do you think it would
Henrik Grunell WebRTC
2015/08/12 15:29:53
I think the raw pointer should be avoided if not n
ivoc
2015/08/13 07:49:23
I'm not sure what you mean exactly by avoiding the
Henrik Grunell WebRTC
2015/08/13 08:13:55
I mean having a scoped_ptr only at one place only.
ivoc
2015/08/13 13:33:43
Ah okay, that is a good point. I moved the RtcEven
| |
| 64 return CreateChannelInternal(external_config, event_log); | |
| 60 } | 65 } |
| 61 | 66 |
| 62 ChannelOwner ChannelManager::CreateChannelInternal(const Config& config) { | 67 ChannelOwner ChannelManager::CreateChannelInternal( |
| 68 const Config& config, | |
| 69 RtcEventLog* const event_log) { | |
| 63 Channel* channel; | 70 Channel* channel; |
| 64 Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, config); | 71 Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, event_log, |
| 72 config); | |
| 65 ChannelOwner channel_owner(channel); | 73 ChannelOwner channel_owner(channel); |
| 66 | 74 |
| 67 CriticalSectionScoped crit(lock_.get()); | 75 CriticalSectionScoped crit(lock_.get()); |
| 68 | 76 |
| 69 channels_.push_back(channel_owner); | 77 channels_.push_back(channel_owner); |
| 70 | 78 |
| 71 return channel_owner; | 79 return channel_owner; |
| 72 } | 80 } |
| 73 | 81 |
| 74 ChannelOwner ChannelManager::GetChannel(int32_t channel_id) { | 82 ChannelOwner ChannelManager::GetChannel(int32_t channel_id) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 bool ChannelManager::Iterator::IsValid() { | 150 bool ChannelManager::Iterator::IsValid() { |
| 143 return iterator_pos_ < channels_.size(); | 151 return iterator_pos_ < channels_.size(); |
| 144 } | 152 } |
| 145 | 153 |
| 146 void ChannelManager::Iterator::Increment() { | 154 void ChannelManager::Iterator::Increment() { |
| 147 ++iterator_pos_; | 155 ++iterator_pos_; |
| 148 } | 156 } |
| 149 | 157 |
| 150 } // namespace voe | 158 } // namespace voe |
| 151 } // namespace webrtc | 159 } // namespace webrtc |
| OLD | NEW |