Commit ac6c0832 authored by Elad Alon's avatar Elad Alon Committed by Commit Bot

Prevent null pointer dereferencing in WebRtcRemoteEventLogManager

|network_connection_tracker_| might never be set (if no profile
is loaded). In that case, it should not be dereferenced.

Bug: 866865
Change-Id: I490be08795f41908d7ac49fdcd5d8588fbea83b7
Reviewed-on: https://chromium-review.googlesource.com/1148335
Commit-Queue: Elad Alon <eladalon@chromium.org>
Reviewed-by: default avatarMax Morin <maxmorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577528}
parent 1b874728
......@@ -162,9 +162,17 @@ WebRtcRemoteEventLogManager::~WebRtcRemoteEventLogManager() {
// while destruction took place, thereby avoiding endless attempts to upload
// the same file.
// |network_connection_tracker_| might already have posted a task back to us,
// but it will not run, because |task_runner_| has already been stopped.
network_connection_tracker_->RemoveNetworkConnectionObserver(this);
if (network_connection_tracker_) {
// * |network_connection_tracker_| might already have posted a task back
// to us, but it will not run, because |task_runner_| has already been
// stopped.
// * RemoveNetworkConnectionObserver() should generally be called on the
// same thread as AddNetworkConnectionObserver(), but in this case it's
// okay to remove on a separate thread, because this only happens during
// Chrome shutdown, when no others tasks are running; there can be no
// concurrently executing notification from the tracker.
network_connection_tracker_->RemoveNetworkConnectionObserver(this);
}
}
void WebRtcRemoteEventLogManager::SetNetworkConnectionTracker(
......
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