Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "webrtc/api/mediastreamproxy.h" | 25 #include "webrtc/api/mediastreamproxy.h" |
| 26 #include "webrtc/api/mediastreamtrackproxy.h" | 26 #include "webrtc/api/mediastreamtrackproxy.h" |
| 27 #include "webrtc/api/remoteaudiosource.h" | 27 #include "webrtc/api/remoteaudiosource.h" |
| 28 #include "webrtc/api/remotevideocapturer.h" | 28 #include "webrtc/api/remotevideocapturer.h" |
| 29 #include "webrtc/api/rtpreceiver.h" | 29 #include "webrtc/api/rtpreceiver.h" |
| 30 #include "webrtc/api/rtpsender.h" | 30 #include "webrtc/api/rtpsender.h" |
| 31 #include "webrtc/api/streamcollection.h" | 31 #include "webrtc/api/streamcollection.h" |
| 32 #include "webrtc/api/videosource.h" | 32 #include "webrtc/api/videosource.h" |
| 33 #include "webrtc/api/videotrack.h" | 33 #include "webrtc/api/videotrack.h" |
| 34 #include "webrtc/base/arraysize.h" | 34 #include "webrtc/base/arraysize.h" |
| 35 #include "webrtc/base/bind.h" | |
| 35 #include "webrtc/base/logging.h" | 36 #include "webrtc/base/logging.h" |
| 36 #include "webrtc/base/stringencode.h" | 37 #include "webrtc/base/stringencode.h" |
| 37 #include "webrtc/base/stringutils.h" | 38 #include "webrtc/base/stringutils.h" |
| 38 #include "webrtc/base/trace_event.h" | 39 #include "webrtc/base/trace_event.h" |
| 40 #include "webrtc/call.h" | |
| 41 #include "webrtc/call/rtc_event_log.h" | |
| 39 #include "webrtc/media/sctp/sctpdataengine.h" | 42 #include "webrtc/media/sctp/sctpdataengine.h" |
| 40 #include "webrtc/p2p/client/basicportallocator.h" | 43 #include "webrtc/p2p/client/basicportallocator.h" |
| 41 #include "webrtc/pc/channelmanager.h" | 44 #include "webrtc/pc/channelmanager.h" |
| 42 #include "webrtc/system_wrappers/include/field_trial.h" | 45 #include "webrtc/system_wrappers/include/field_trial.h" |
| 43 | 46 |
| 44 namespace { | 47 namespace { |
| 45 | 48 |
| 46 using webrtc::DataChannel; | 49 using webrtc::DataChannel; |
| 47 using webrtc::MediaConstraintsInterface; | 50 using webrtc::MediaConstraintsInterface; |
| 48 using webrtc::MediaStreamInterface; | 51 using webrtc::MediaStreamInterface; |
| (...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2092 | 2095 |
| 2093 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2096 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| 2094 for (const auto& channel : sctp_data_channels_) { | 2097 for (const auto& channel : sctp_data_channels_) { |
| 2095 if (channel->id() == sid) { | 2098 if (channel->id() == sid) { |
| 2096 return channel; | 2099 return channel; |
| 2097 } | 2100 } |
| 2098 } | 2101 } |
| 2099 return nullptr; | 2102 return nullptr; |
| 2100 } | 2103 } |
| 2101 | 2104 |
| 2105 bool PeerConnection::StartRtcEventLog(rtc::PlatformFile file) { | |
|
the sun
2016/03/03 09:25:12
Nit: put methods in the order they are declared in
ivoc
2016/03/10 13:15:36
I moved them to a better place, but it's difficult
| |
| 2106 return factory_->worker_thread()->Invoke<bool>( | |
| 2107 rtc::Bind(&PeerConnection::StartRtcEventLog_w, this, file)); | |
| 2108 } | |
| 2109 | |
| 2110 void PeerConnection::StopRtcEventLog() { | |
| 2111 factory_->worker_thread()->Invoke<void>( | |
| 2112 rtc::Bind(&PeerConnection::StopRtcEventLog_w, this)); | |
| 2113 } | |
| 2114 | |
| 2115 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file) { | |
| 2116 RTC_DCHECK(factory_->worker_thread()->IsCurrent()); | |
| 2117 webrtc::Call* call = media_controller_->call_w(); | |
| 2118 if (call) { | |
|
the sun
2016/03/03 09:25:12
Shouldn't need this condition; add an RTC_DCHECK()
terelius
2016/03/10 10:42:32
I agree. The Call is created indirectly by CreateP
ivoc
2016/03/10 13:15:36
Good idea, done.
| |
| 2119 return call->RtcEventLog()->StartLogging(file); | |
| 2120 } | |
| 2121 return false; | |
| 2122 } | |
| 2123 | |
| 2124 void PeerConnection::StopRtcEventLog_w() { | |
| 2125 RTC_DCHECK(factory_->worker_thread()->IsCurrent()); | |
| 2126 webrtc::Call* call = media_controller_->call_w(); | |
| 2127 if (call) { | |
| 2128 call->RtcEventLog()->StopLogging(); | |
| 2129 } | |
| 2130 } | |
| 2102 } // namespace webrtc | 2131 } // namespace webrtc |
| OLD | NEW |