Commit e8b80d38 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Add initialization of RTCPeerConnectionHandler for tests.

This avoids some MSAN error messages.

Bug: chromium:787254
Change-Id: If01797d8bd1a57ea44a151ad3bdd74e3cb4aecc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152365
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759612}
parent 249664a3
...@@ -1061,10 +1061,7 @@ RTCPeerConnectionHandler::RTCPeerConnectionHandler( ...@@ -1061,10 +1061,7 @@ RTCPeerConnectionHandler::RTCPeerConnectionHandler(
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool force_encoded_audio_insertable_streams, bool force_encoded_audio_insertable_streams,
bool force_encoded_video_insertable_streams) bool force_encoded_video_insertable_streams)
: initialize_called_(false), : client_(client),
client_(client),
is_closed_(false),
is_unregistered_(false),
dependency_factory_(dependency_factory), dependency_factory_(dependency_factory),
track_adapter_map_( track_adapter_map_(
base::MakeRefCounted<blink::WebRtcMediaStreamTrackAdapterMap>( base::MakeRefCounted<blink::WebRtcMediaStreamTrackAdapterMap>(
...@@ -1083,8 +1080,7 @@ RTCPeerConnectionHandler::RTCPeerConnectionHandler( ...@@ -1083,8 +1080,7 @@ RTCPeerConnectionHandler::RTCPeerConnectionHandler(
// Constructor to be used for creating mocks only. // Constructor to be used for creating mocks only.
RTCPeerConnectionHandler::RTCPeerConnectionHandler( RTCPeerConnectionHandler::RTCPeerConnectionHandler(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: client_(nullptr), : is_unregistered_(true), // Avoid StopAndUnregister in destructor
dependency_factory_(nullptr),
task_runner_(std::move(task_runner)) {} task_runner_(std::move(task_runner)) {}
RTCPeerConnectionHandler::~RTCPeerConnectionHandler() { RTCPeerConnectionHandler::~RTCPeerConnectionHandler() {
......
...@@ -371,20 +371,20 @@ class MODULES_EXPORT RTCPeerConnectionHandler { ...@@ -371,20 +371,20 @@ class MODULES_EXPORT RTCPeerConnectionHandler {
// Initialize() is never expected to be called more than once, even if the // Initialize() is never expected to be called more than once, even if the
// first call fails. // first call fails.
bool initialize_called_; bool initialize_called_ = false;
// |client_| is a raw pointer to the blink object (blink::RTCPeerConnection) // |client_| is a raw pointer to the blink object (blink::RTCPeerConnection)
// that owns this object. // that owns this object.
// It is valid for the lifetime of this object, but is cleared when // It is valid for the lifetime of this object, but is cleared when
// StopAndUnregister() is called, in order to make sure it doesn't // StopAndUnregister() is called, in order to make sure it doesn't
// interfere with garbage collection of the owner object. // interfere with garbage collection of the owner object.
RTCPeerConnectionHandlerClient* client_; RTCPeerConnectionHandlerClient* client_ = nullptr;
// True if this PeerConnection has been closed. // True if this PeerConnection has been closed.
// After the PeerConnection has been closed, this object may no longer // After the PeerConnection has been closed, this object may no longer
// forward callbacks to blink. // forward callbacks to blink.
bool is_closed_; bool is_closed_ = false;
// True if StopAndUnregister has been called. // True if StopAndUnregister has been called.
bool is_unregistered_; bool is_unregistered_ = false;
// Transition from kHaveLocalOffer to kHaveRemoteOffer indicates implicit // Transition from kHaveLocalOffer to kHaveRemoteOffer indicates implicit
// rollback in which case we need to also make visiting of kStable observable. // rollback in which case we need to also make visiting of kStable observable.
...@@ -393,7 +393,7 @@ class MODULES_EXPORT RTCPeerConnectionHandler { ...@@ -393,7 +393,7 @@ class MODULES_EXPORT RTCPeerConnectionHandler {
// |dependency_factory_| is a raw pointer, and is valid for the lifetime of // |dependency_factory_| is a raw pointer, and is valid for the lifetime of
// RenderThreadImpl. // RenderThreadImpl.
blink::PeerConnectionDependencyFactory* const dependency_factory_; blink::PeerConnectionDependencyFactory* const dependency_factory_ = nullptr;
blink::WebLocalFrame* frame_ = nullptr; blink::WebLocalFrame* frame_ = nullptr;
...@@ -441,8 +441,8 @@ class MODULES_EXPORT RTCPeerConnectionHandler { ...@@ -441,8 +441,8 @@ class MODULES_EXPORT RTCPeerConnectionHandler {
// used when constructing the PeerConnection carry over when // used when constructing the PeerConnection carry over when
// SetConfiguration is called. // SetConfiguration is called.
webrtc::PeerConnectionInterface::RTCConfiguration configuration_; webrtc::PeerConnectionInterface::RTCConfiguration configuration_;
bool force_encoded_audio_insertable_streams_; bool force_encoded_audio_insertable_streams_ = false;
bool force_encoded_video_insertable_streams_; bool force_encoded_video_insertable_streams_ = false;
// Record info about the first SessionDescription from the local and // Record info about the first SessionDescription from the local and
// remote side to record UMA stats once both are set. We only check // remote side to record UMA stats once both are set. We only check
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment