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

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

Issue 2347103003: Implement the MediaStreamTrackEvent constructor (Closed)
Patch Set: update webexposed Created 4 years, 2 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 | « third_party/WebKit/Source/modules/modules_idl_files.gni ('k') | 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 (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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 { 1089 {
1090 DCHECK(!m_closed); 1090 DCHECK(!m_closed);
1091 DCHECK(getExecutionContext()->isContextThread()); 1091 DCHECK(getExecutionContext()->isContextThread());
1092 1092
1093 if (m_signalingState == SignalingStateClosed) 1093 if (m_signalingState == SignalingStateClosed)
1094 return; 1094 return;
1095 1095
1096 MediaStream* stream = MediaStream::create(getExecutionContext(), remoteStrea m); 1096 MediaStream* stream = MediaStream::create(getExecutionContext(), remoteStrea m);
1097 m_remoteStreams.append(stream); 1097 m_remoteStreams.append(stream);
1098 1098
1099 scheduleDispatchEvent(MediaStreamEvent::create(EventTypeNames::addstream, fa lse, false, stream)); 1099 scheduleDispatchEvent(MediaStreamEvent::create(EventTypeNames::addstream, st ream));
1100 } 1100 }
1101 1101
1102 void RTCPeerConnection::didRemoveRemoteStream(const WebMediaStream& remoteStream ) 1102 void RTCPeerConnection::didRemoveRemoteStream(const WebMediaStream& remoteStream )
1103 { 1103 {
1104 DCHECK(!m_closed); 1104 DCHECK(!m_closed);
1105 DCHECK(getExecutionContext()->isContextThread()); 1105 DCHECK(getExecutionContext()->isContextThread());
1106 1106
1107 MediaStreamDescriptor* streamDescriptor = remoteStream; 1107 MediaStreamDescriptor* streamDescriptor = remoteStream;
1108 DCHECK(streamDescriptor->client()); 1108 DCHECK(streamDescriptor->client());
1109 1109
1110 MediaStream* stream = static_cast<MediaStream*>(streamDescriptor->client()); 1110 MediaStream* stream = static_cast<MediaStream*>(streamDescriptor->client());
1111 stream->streamEnded(); 1111 stream->streamEnded();
1112 1112
1113 if (m_signalingState == SignalingStateClosed) 1113 if (m_signalingState == SignalingStateClosed)
1114 return; 1114 return;
1115 1115
1116 size_t pos = m_remoteStreams.find(stream); 1116 size_t pos = m_remoteStreams.find(stream);
1117 DCHECK(pos != kNotFound); 1117 DCHECK(pos != kNotFound);
1118 m_remoteStreams.remove(pos); 1118 m_remoteStreams.remove(pos);
1119 1119
1120 scheduleDispatchEvent(MediaStreamEvent::create(EventTypeNames::removestream, false, false, stream)); 1120 scheduleDispatchEvent(MediaStreamEvent::create(EventTypeNames::removestream, stream));
1121 } 1121 }
1122 1122
1123 void RTCPeerConnection::didAddRemoteDataChannel(WebRTCDataChannelHandler* handle r) 1123 void RTCPeerConnection::didAddRemoteDataChannel(WebRTCDataChannelHandler* handle r)
1124 { 1124 {
1125 DCHECK(!m_closed); 1125 DCHECK(!m_closed);
1126 DCHECK(getExecutionContext()->isContextThread()); 1126 DCHECK(getExecutionContext()->isContextThread());
1127 1127
1128 if (m_signalingState == SignalingStateClosed) 1128 if (m_signalingState == SignalingStateClosed)
1129 return; 1129 return;
1130 1130
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 { 1279 {
1280 visitor->trace(m_localStreams); 1280 visitor->trace(m_localStreams);
1281 visitor->trace(m_remoteStreams); 1281 visitor->trace(m_remoteStreams);
1282 visitor->trace(m_dispatchScheduledEventRunner); 1282 visitor->trace(m_dispatchScheduledEventRunner);
1283 visitor->trace(m_scheduledEvents); 1283 visitor->trace(m_scheduledEvents);
1284 EventTargetWithInlineData::trace(visitor); 1284 EventTargetWithInlineData::trace(visitor);
1285 ActiveDOMObject::trace(visitor); 1285 ActiveDOMObject::trace(visitor);
1286 } 1286 }
1287 1287
1288 } // namespace blink 1288 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules_idl_files.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698