Chromium Code Reviews| Index: webrtc/pc/peerconnection.cc | 
| diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc | 
| index 852dd39de5bc21eed1461340f796d4ef0132e55f..eed4c0d974bf03ed9c3a7af249b6b36502cd099f 100644 | 
| --- a/webrtc/pc/peerconnection.cc | 
| +++ b/webrtc/pc/peerconnection.cc | 
| @@ -220,6 +220,10 @@ bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) { | 
| namespace webrtc { | 
| +std::unique_ptr<RtcEventLog> CreateRtcEventLog(); | 
| + | 
| +Call* CreateCall(const Call::Config& config); | 
| + | 
| bool PeerConnectionInterface::RTCConfiguration::operator==( | 
| const PeerConnectionInterface::RTCConfiguration& o) const { | 
| // This static_assert prevents us from accidentally breaking operator==. | 
| @@ -395,7 +399,7 @@ PeerConnection::PeerConnection(PeerConnectionFactory* factory) | 
| : factory_(factory), | 
| observer_(NULL), | 
| uma_observer_(NULL), | 
| - event_log_(RtcEventLog::Create()), | 
| + event_log_(CreateRtcEventLog()), | 
| signaling_state_(kStable), | 
| ice_connection_state_(kIceConnectionNew), | 
| ice_gathering_state_(kIceGatheringNew), | 
| @@ -2335,13 +2339,17 @@ void PeerConnection::CreateCall_w() { | 
| const int kMaxBandwidthBps = 2000000; | 
| webrtc::Call::Config call_config(event_log_.get()); | 
| + if (!factory_->channel_manager()->media_engine()) { | 
| + LOG(LS_WARNING) | 
| + << "Failed to create the Call because the media engine is unset."; | 
| 
 
Taylor Brandstetter
2017/05/30 17:30:53
Other comment about log levels applies here too.
 
Zhi Huang
2017/05/31 00:03:29
Done.
 
 | 
| + return; | 
| + } | 
| call_config.audio_state = | 
| - factory_->channel_manager() ->media_engine()->GetAudioState(); | 
| + factory_->channel_manager()->media_engine()->GetAudioState(); | 
| call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 
| call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 
| call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 
| - | 
| - call_.reset(webrtc::Call::Create(call_config)); | 
| + call_.reset(CreateCall(call_config)); | 
| } | 
| } // namespace webrtc |