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

Side by Side Diff: Source/modules/mediastream/MediaStream.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 return; 174 return;
175 } 175 }
176 176
177 if (!prpTrack) { 177 if (!prpTrack) {
178 es.throwDOMException(TypeMismatchError); 178 es.throwDOMException(TypeMismatchError);
179 return; 179 return;
180 } 180 }
181 181
182 RefPtr<MediaStreamTrack> track = prpTrack; 182 RefPtr<MediaStreamTrack> track = prpTrack;
183 183
184 size_t pos = notFound; 184 size_t pos = kNotFound;
185 switch (track->component()->source()->type()) { 185 switch (track->component()->source()->type()) {
186 case MediaStreamSource::TypeAudio: 186 case MediaStreamSource::TypeAudio:
187 pos = m_audioTracks.find(track); 187 pos = m_audioTracks.find(track);
188 if (pos != notFound) 188 if (pos != kNotFound)
189 m_audioTracks.remove(pos); 189 m_audioTracks.remove(pos);
190 break; 190 break;
191 case MediaStreamSource::TypeVideo: 191 case MediaStreamSource::TypeVideo:
192 pos = m_videoTracks.find(track); 192 pos = m_videoTracks.find(track);
193 if (pos != notFound) 193 if (pos != kNotFound)
194 m_videoTracks.remove(pos); 194 m_videoTracks.remove(pos);
195 break; 195 break;
196 } 196 }
197 197
198 if (pos == notFound) 198 if (pos == kNotFound)
199 return; 199 return;
200 200
201 m_descriptor->removeComponent(track->component()); 201 m_descriptor->removeComponent(track->component());
202 202
203 if (!m_audioTracks.size() && !m_videoTracks.size()) 203 if (!m_audioTracks.size() && !m_videoTracks.size())
204 m_descriptor->setEnded(); 204 m_descriptor->setEnded();
205 205
206 MediaStreamCenter::instance().didRemoveMediaStreamTrack(m_descriptor.get(), track->component()); 206 MediaStreamCenter::instance().didRemoveMediaStreamTrack(m_descriptor.get(), track->component());
207 } 207 }
208 208
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 MediaStreamTrackVector* tracks = 0; 309 MediaStreamTrackVector* tracks = 0;
310 switch (component->source()->type()) { 310 switch (component->source()->type()) {
311 case MediaStreamSource::TypeAudio: 311 case MediaStreamSource::TypeAudio:
312 tracks = &m_audioTracks; 312 tracks = &m_audioTracks;
313 break; 313 break;
314 case MediaStreamSource::TypeVideo: 314 case MediaStreamSource::TypeVideo:
315 tracks = &m_videoTracks; 315 tracks = &m_videoTracks;
316 break; 316 break;
317 } 317 }
318 318
319 size_t index = notFound; 319 size_t index = kNotFound;
320 for (size_t i = 0; i < tracks->size(); ++i) { 320 for (size_t i = 0; i < tracks->size(); ++i) {
321 if ((*tracks)[i]->component() == component) { 321 if ((*tracks)[i]->component() == component) {
322 index = i; 322 index = i;
323 break; 323 break;
324 } 324 }
325 } 325 }
326 if (index == notFound) 326 if (index == kNotFound)
327 return; 327 return;
328 328
329 m_descriptor->removeComponent(component); 329 m_descriptor->removeComponent(component);
330 330
331 RefPtr<MediaStreamTrack> track = (*tracks)[index]; 331 RefPtr<MediaStreamTrack> track = (*tracks)[index];
332 tracks->remove(index); 332 tracks->remove(index);
333 scheduleDispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrack Event, false, false, track)); 333 scheduleDispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrack Event, false, false, track));
334 } 334 }
335 335
336 void MediaStream::scheduleDispatchEvent(PassRefPtr<Event> event) 336 void MediaStream::scheduleDispatchEvent(PassRefPtr<Event> event)
(...skipping 18 matching lines...) Expand all
355 355
356 events.clear(); 356 events.clear();
357 } 357 }
358 358
359 URLRegistry& MediaStream::registry() const 359 URLRegistry& MediaStream::registry() const
360 { 360 {
361 return MediaStreamRegistry::registry(); 361 return MediaStreamRegistry::registry();
362 } 362 }
363 363
364 } // namespace WebCore 364 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediasource/WebKitSourceBufferList.cpp ('k') | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698