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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp

Issue 2703833002: Migrate WTF::HashSet::remove() to ::erase() [part 2] (Closed)
Patch Set: Created 3 years, 10 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 bool MediaStreamSource::removeAudioConsumer( 81 bool MediaStreamSource::removeAudioConsumer(
82 AudioDestinationConsumer* consumer) { 82 AudioDestinationConsumer* consumer) {
83 ASSERT(m_requiresConsumer); 83 ASSERT(m_requiresConsumer);
84 MutexLocker locker(m_audioConsumersLock); 84 MutexLocker locker(m_audioConsumersLock);
85 HeapHashSet<Member<AudioDestinationConsumer>>::iterator it = 85 HeapHashSet<Member<AudioDestinationConsumer>>::iterator it =
86 m_audioConsumers.find(consumer); 86 m_audioConsumers.find(consumer);
87 if (it == m_audioConsumers.end()) 87 if (it == m_audioConsumers.end())
88 return false; 88 return false;
89 m_audioConsumers.remove(it); 89 m_audioConsumers.erase(it);
90 return true; 90 return true;
91 } 91 }
92 92
93 void MediaStreamSource::getSettings(WebMediaStreamTrack::Settings& settings) { 93 void MediaStreamSource::getSettings(WebMediaStreamTrack::Settings& settings) {
94 settings.deviceId = id(); 94 settings.deviceId = id();
95 } 95 }
96 96
97 void MediaStreamSource::setAudioFormat(size_t numberOfChannels, 97 void MediaStreamSource::setAudioFormat(size_t numberOfChannels,
98 float sampleRate) { 98 float sampleRate) {
99 ASSERT(m_requiresConsumer); 99 ASSERT(m_requiresConsumer);
(...skipping 12 matching lines...) Expand all
112 it != m_audioConsumers.end(); ++it) 112 it != m_audioConsumers.end(); ++it)
113 (*it)->consumeAudio(bus, numberOfFrames); 113 (*it)->consumeAudio(bus, numberOfFrames);
114 } 114 }
115 115
116 DEFINE_TRACE(MediaStreamSource) { 116 DEFINE_TRACE(MediaStreamSource) {
117 visitor->trace(m_observers); 117 visitor->trace(m_observers);
118 visitor->trace(m_audioConsumers); 118 visitor->trace(m_audioConsumers);
119 } 119 }
120 120
121 } // namespace blink 121 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBDevice.cpp ('k') | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698