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

Unified Diff: content/browser/media/webrtc/webrtc_eventlog_host.cc

Issue 2139913003: Fix for crash found by IPC fuzzing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc/webrtc_eventlog_host.cc
diff --git a/content/browser/media/webrtc/webrtc_eventlog_host.cc b/content/browser/media/webrtc/webrtc_eventlog_host.cc
index 279ed48b0c3d34945318f005986130e09cd49243..80aec9a3f4b1df98bcdf4fff1da62cbb048c54e6 100644
--- a/content/browser/media/webrtc/webrtc_eventlog_host.cc
+++ b/content/browser/media/webrtc/webrtc_eventlog_host.cc
@@ -78,14 +78,15 @@ WebRTCEventLogHost::~WebRTCEventLogHost() {
void WebRTCEventLogHost::PeerConnectionAdded(int peer_connection_local_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(std::find(active_peer_connection_local_ids_.begin(),
- active_peer_connection_local_ids_.end(),
- peer_connection_local_id) ==
- active_peer_connection_local_ids_.end());
- active_peer_connection_local_ids_.push_back(peer_connection_local_id);
- if (rtc_event_logging_enabled_ &&
- number_active_log_files_ < kMaxNumberLogFiles) {
- StartEventLogForPeerConnection(peer_connection_local_id);
+ if (std::find(active_peer_connection_local_ids_.begin(),
+ active_peer_connection_local_ids_.end(),
+ peer_connection_local_id) ==
+ active_peer_connection_local_ids_.end()) {
+ active_peer_connection_local_ids_.push_back(peer_connection_local_id);
+ if (rtc_event_logging_enabled_ &&
+ number_active_log_files_ < kMaxNumberLogFiles) {
+ StartEventLogForPeerConnection(peer_connection_local_id);
+ }
}
}
@@ -94,8 +95,9 @@ void WebRTCEventLogHost::PeerConnectionRemoved(int peer_connection_local_id) {
const auto found = std::find(active_peer_connection_local_ids_.begin(),
active_peer_connection_local_ids_.end(),
peer_connection_local_id);
- DCHECK(found != active_peer_connection_local_ids_.end());
- active_peer_connection_local_ids_.erase(found);
+ if (found != active_peer_connection_local_ids_.end()) {
+ active_peer_connection_local_ids_.erase(found);
+ }
}
bool WebRTCEventLogHost::StartWebRTCEventLog(const base::FilePath& file_path) {
« 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