Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: webrtc/pc/peerconnectionfactory.cc

Issue 3012763002: Avoid construction of unused RtcEventLogNullImpl object (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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
11 #include "webrtc/pc/peerconnectionfactory.h" 11 #include "webrtc/pc/peerconnectionfactory.h"
12 12
13 #include <utility> 13 #include <utility>
14 14
15 #include "webrtc/api/mediaconstraintsinterface.h" 15 #include "webrtc/api/mediaconstraintsinterface.h"
16 #include "webrtc/api/mediastreamproxy.h" 16 #include "webrtc/api/mediastreamproxy.h"
17 #include "webrtc/api/mediastreamtrackproxy.h" 17 #include "webrtc/api/mediastreamtrackproxy.h"
18 #include "webrtc/api/peerconnectionfactoryproxy.h" 18 #include "webrtc/api/peerconnectionfactoryproxy.h"
19 #include "webrtc/api/peerconnectionproxy.h" 19 #include "webrtc/api/peerconnectionproxy.h"
20 #include "webrtc/api/videosourceproxy.h" 20 #include "webrtc/api/videosourceproxy.h"
21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
22 #include "webrtc/rtc_base/bind.h" 22 #include "webrtc/rtc_base/bind.h"
23 #include "webrtc/rtc_base/checks.h" 23 #include "webrtc/rtc_base/checks.h"
24 #include "webrtc/rtc_base/ptr_util.h"
24 // Adding 'nogncheck' to disable the gn include headers check to support modular 25 // Adding 'nogncheck' to disable the gn include headers check to support modular
25 // WebRTC build targets. 26 // WebRTC build targets.
26 // TODO(zhihuang): This wouldn't be necessary if the interface and 27 // TODO(zhihuang): This wouldn't be necessary if the interface and
27 // implementation of the media engine were in separate build targets. 28 // implementation of the media engine were in separate build targets.
28 #include "webrtc/media/engine/webrtcmediaengine.h" // nogncheck 29 #include "webrtc/media/engine/webrtcmediaengine.h" // nogncheck
29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" // nogncheck 30 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" // nogncheck
30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" // nogncheck 31 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" // nogncheck
31 #include "webrtc/modules/audio_device/include/audio_device.h" // nogncheck 32 #include "webrtc/modules/audio_device/include/audio_device.h" // nogncheck
32 #include "webrtc/p2p/base/basicpacketsocketfactory.h" 33 #include "webrtc/p2p/base/basicpacketsocketfactory.h"
33 #include "webrtc/p2p/client/basicportallocator.h" 34 #include "webrtc/p2p/client/basicportallocator.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 254 }
254 255
255 if (!allocator) { 256 if (!allocator) {
256 allocator.reset(new cricket::BasicPortAllocator( 257 allocator.reset(new cricket::BasicPortAllocator(
257 default_network_manager_.get(), default_socket_factory_.get())); 258 default_network_manager_.get(), default_socket_factory_.get()));
258 } 259 }
259 network_thread_->Invoke<void>( 260 network_thread_->Invoke<void>(
260 RTC_FROM_HERE, rtc::Bind(&cricket::PortAllocator::SetNetworkIgnoreMask, 261 RTC_FROM_HERE, rtc::Bind(&cricket::PortAllocator::SetNetworkIgnoreMask,
261 allocator.get(), options_.network_ignore_mask)); 262 allocator.get(), options_.network_ignore_mask));
262 263
263 std::unique_ptr<RtcEventLog> event_log(new RtcEventLogNullImpl()); 264 std::unique_ptr<RtcEventLog> event_log =
264 if (event_log_factory_) { 265 event_log_factory_ ? event_log_factory_->CreateRtcEventLog()
265 event_log = event_log_factory_->CreateRtcEventLog(); 266 : rtc::MakeUnique<RtcEventLogNullImpl>();
266 }
267 267
268 std::unique_ptr<Call> call = worker_thread_->Invoke<std::unique_ptr<Call>>( 268 std::unique_ptr<Call> call = worker_thread_->Invoke<std::unique_ptr<Call>>(
269 RTC_FROM_HERE, 269 RTC_FROM_HERE,
270 rtc::Bind(&PeerConnectionFactory::CreateCall_w, this, event_log.get())); 270 rtc::Bind(&PeerConnectionFactory::CreateCall_w, this, event_log.get()));
271 271
272 rtc::scoped_refptr<PeerConnection> pc( 272 rtc::scoped_refptr<PeerConnection> pc(
273 new rtc::RefCountedObject<PeerConnection>(this, std::move(event_log), 273 new rtc::RefCountedObject<PeerConnection>(this, std::move(event_log),
274 std::move(call))); 274 std::move(call)));
275 275
276 if (!pc->Initialize(configuration, std::move(allocator), 276 if (!pc->Initialize(configuration, std::move(allocator),
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); 344 call_config.audio_state = channel_manager_->media_engine()->GetAudioState();
345 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; 345 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps;
346 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; 346 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps;
347 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; 347 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps;
348 348
349 return std::unique_ptr<Call>(call_factory_->CreateCall(call_config)); 349 return std::unique_ptr<Call>(call_factory_->CreateCall(call_config));
350 } 350 }
351 351
352 } // namespace webrtc 352 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698