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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 exceptionState.throwDOMException( 1114 exceptionState.throwDOMException(
1115 TypeMismatchError, 1115 TypeMismatchError,
1116 ExceptionMessages::argumentNullOrIncorrectType(1, "MediaStream")); 1116 ExceptionMessages::argumentNullOrIncorrectType(1, "MediaStream"));
1117 return; 1117 return;
1118 } 1118 }
1119 1119
1120 size_t pos = m_localStreams.find(stream); 1120 size_t pos = m_localStreams.find(stream);
1121 if (pos == kNotFound) 1121 if (pos == kNotFound)
1122 return; 1122 return;
1123 1123
1124 m_localStreams.remove(pos); 1124 m_localStreams.erase(pos);
1125 1125
1126 m_peerHandler->removeStream(stream->descriptor()); 1126 m_peerHandler->removeStream(stream->descriptor());
1127 } 1127 }
1128 1128
1129 MediaStreamVector RTCPeerConnection::getLocalStreams() const { 1129 MediaStreamVector RTCPeerConnection::getLocalStreams() const {
1130 return m_localStreams; 1130 return m_localStreams;
1131 } 1131 }
1132 1132
1133 MediaStreamVector RTCPeerConnection::getRemoteStreams() const { 1133 MediaStreamVector RTCPeerConnection::getRemoteStreams() const {
1134 return m_remoteStreams; 1134 return m_remoteStreams;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 DCHECK(streamDescriptor->client()); 1324 DCHECK(streamDescriptor->client());
1325 1325
1326 MediaStream* stream = static_cast<MediaStream*>(streamDescriptor->client()); 1326 MediaStream* stream = static_cast<MediaStream*>(streamDescriptor->client());
1327 stream->streamEnded(); 1327 stream->streamEnded();
1328 1328
1329 if (m_signalingState == SignalingStateClosed) 1329 if (m_signalingState == SignalingStateClosed)
1330 return; 1330 return;
1331 1331
1332 size_t pos = m_remoteStreams.find(stream); 1332 size_t pos = m_remoteStreams.find(stream);
1333 DCHECK(pos != kNotFound); 1333 DCHECK(pos != kNotFound);
1334 m_remoteStreams.remove(pos); 1334 m_remoteStreams.erase(pos);
1335 1335
1336 scheduleDispatchEvent( 1336 scheduleDispatchEvent(
1337 MediaStreamEvent::create(EventTypeNames::removestream, stream)); 1337 MediaStreamEvent::create(EventTypeNames::removestream, stream));
1338 } 1338 }
1339 1339
1340 void RTCPeerConnection::didAddRemoteDataChannel( 1340 void RTCPeerConnection::didAddRemoteDataChannel(
1341 WebRTCDataChannelHandler* handler) { 1341 WebRTCDataChannelHandler* handler) {
1342 DCHECK(!m_closed); 1342 DCHECK(!m_closed);
1343 DCHECK(getExecutionContext()->isContextThread()); 1343 DCHECK(getExecutionContext()->isContextThread());
1344 1344
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 DEFINE_TRACE(RTCPeerConnection) { 1505 DEFINE_TRACE(RTCPeerConnection) {
1506 visitor->trace(m_localStreams); 1506 visitor->trace(m_localStreams);
1507 visitor->trace(m_remoteStreams); 1507 visitor->trace(m_remoteStreams);
1508 visitor->trace(m_dispatchScheduledEventRunner); 1508 visitor->trace(m_dispatchScheduledEventRunner);
1509 visitor->trace(m_scheduledEvents); 1509 visitor->trace(m_scheduledEvents);
1510 EventTargetWithInlineData::trace(visitor); 1510 EventTargetWithInlineData::trace(visitor);
1511 SuspendableObject::trace(visitor); 1511 SuspendableObject::trace(visitor);
1512 } 1512 }
1513 1513
1514 } // namespace blink 1514 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698