Diff
Modified: trunk/Source/WebCore/ChangeLog (185315 => 185316)
--- trunk/Source/WebCore/ChangeLog 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/ChangeLog 2015-06-08 14:36:47 UTC (rev 185316)
@@ -1,3 +1,94 @@
+2015-06-08 Hunseop Jeong <[email protected]>
+
+ Use modern for-loops in WebCore/Modules - 2
+ https://bugs.webkit.org/show_bug.cgi?id=145541
+
+ Reviewed by Darin Adler.
+
+ No new tests, no behavior changes.
+
+ * Modules/mediastream/RTCConfiguration.h:
+ (WebCore::RTCConfiguration::iceServers):
+ * Modules/mediastream/RTCDTMFSender.cpp:
+ (WebCore::RTCDTMFSender::scheduledEventTimerFired):
+ * Modules/mediastream/RTCDataChannel.cpp:
+ (WebCore::RTCDataChannel::scheduledEventTimerFired):
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::processIceServer):
+ (WebCore::RTCPeerConnection::~RTCPeerConnection):
+ (WebCore::RTCPeerConnection::getStreamById):
+ (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId):
+ (WebCore::RTCPeerConnection::stop):
+ (WebCore::RTCPeerConnection::scheduledEventTimerFired):
+ * Modules/mediastream/RTCStatsReport.cpp:
+ (WebCore::RTCStatsReport::names):
+ * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+ (WebCore::initProtocolHandlerWhitelist):
+ * Modules/speech/SpeechSynthesis.cpp:
+ (WebCore::SpeechSynthesis::getVoices):
+ * Modules/webaudio/AudioBuffer.cpp:
+ (WebCore::AudioBuffer::memoryCost):
+ * Modules/webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::createMediaStreamSource):
+ (WebCore::AudioContext::derefFinishedSourceNodes):
+ (WebCore::AudioContext::derefUnfinishedSourceNodes):
+ (WebCore::AudioContext::handleDeferredFinishDerefs):
+ (WebCore::AudioContext::handleDirtyAudioSummingJunctions):
+ (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
+ (WebCore::AudioContext::updateAutomaticPullNodes):
+ (WebCore::AudioContext::processAutomaticPullNodes):
+ * Modules/webaudio/AudioNode.cpp:
+ (WebCore::AudioNode::updateChannelsForInputs):
+ (WebCore::AudioNode::checkNumberOfChannelsForInput):
+ (WebCore::AudioNode::pullInputs):
+ (WebCore::AudioNode::inputsAreSilent):
+ (WebCore::AudioNode::silenceOutputs):
+ (WebCore::AudioNode::unsilenceOutputs):
+ (WebCore::AudioNode::enableOutputsIfNecessary):
+ (WebCore::AudioNode::disableOutputsIfNecessary):
+ (WebCore::AudioNode::finishDeref):
+ * Modules/webaudio/AudioNodeInput.cpp:
+ (WebCore::AudioNodeInput::numberOfChannels):
+ (WebCore::AudioNodeInput::sumAllConnections):
+ * Modules/webaudio/AudioNodeOutput.cpp:
+ (WebCore::AudioNodeOutput::propagateChannelCount):
+ (WebCore::AudioNodeOutput::disable):
+ (WebCore::AudioNodeOutput::enable):
+ * Modules/webaudio/AudioParam.cpp:
+ (WebCore::AudioParam::calculateFinalValues):
+ * Modules/webaudio/AudioParamTimeline.cpp:
+ (WebCore::AudioParamTimeline::insertEvent):
+ * Modules/webaudio/AudioSummingJunction.cpp:
+ (WebCore::AudioSummingJunction::updateRenderingState):
+ * Modules/webaudio/MediaStreamAudioSource.cpp:
+ (WebCore::MediaStreamAudioSource::setAudioFormat):
+ (WebCore::MediaStreamAudioSource::consumeAudio):
+ * Modules/webaudio/WaveShaperProcessor.cpp:
+ (WebCore::WaveShaperProcessor::setOversample):
+ * Modules/webdatabase/DatabaseThread.cpp:
+ (WebCore::DatabaseThread::handlePausedQueue):
+ (WebCore::DatabaseThread::databaseThread):
+ * Modules/webdatabase/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
+ (WebCore::DatabaseTracker::databaseNamesForOrigin):
+ (WebCore::DatabaseTracker::getOpenDatabases):
+ (WebCore::DatabaseTracker::usageForOrigin):
+ (WebCore::DatabaseTracker::deleteAllDatabases):
+ (WebCore::DatabaseTracker::deleteOrigin):
+ (WebCore::DatabaseTracker::deleteDatabaseFile):
+ (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
+ (WebCore::DatabaseTracker::setDatabasesPaused):
+ * Modules/webdatabase/SQLTransactionCoordinator.cpp:
+ (WebCore::SQLTransactionCoordinator::shutdown):
+ * Modules/websockets/WebSocket.cpp:
+ (WebCore::WebSocket::connect):
+ * Modules/websockets/WebSocketExtensionDispatcher.cpp:
+ (WebCore::WebSocketExtensionDispatcher::addProcessor):
+ (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):
+ (WebCore::WebSocketExtensionDispatcher::processHeaderValue):
+ * Modules/websockets/WebSocketHandshake.cpp:
+ (WebCore::WebSocketHandshake::clientHandshakeMessage):
+
2015-06-07 Darin Adler <[email protected]>
REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
@@ -69251,7 +69342,7 @@
with callbacks is limiting a number of ways. The callback names are very ambiguous, the callbacks
must either be on a separate object (more boilerplate), or the callback must be public for
HysteresisActivity to call them, or friends get involved. Without the boilerplate of extra
- delegate objects it's hard to scale use of these objects - a single object can't serve as a
+ delegate objects it's hard to scale use of these objects - a single object can't serve as a
delegate for multiple HysteresisActivity members.
Instead, make HysteresisActivity take a lambda to callback on state change. To simplify, changed
Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h (185315 => 185316)
--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h 2015-06-08 14:36:47 UTC (rev 185316)
@@ -67,11 +67,9 @@
Vector<RefPtr<RTCIceServer>> iceServers() const
{
Vector<RefPtr<RTCIceServer>> servers;
- Vector<RefPtr<RTCIceServerPrivate>> privateServers = m_private->iceServers();
+ for (auto& server : m_private->iceServers())
+ servers.append(RTCIceServer::create(server));
- for (auto iter = privateServers.begin(); iter != privateServers.end(); ++iter)
- servers.append(RTCIceServer::create(*iter));
-
return servers;
}
Modified: trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -161,9 +161,8 @@
Vector<RefPtr<Event>> events;
events.swap(m_scheduledEvents);
- Vector<RefPtr<Event>>::iterator it = events.begin();
- for (; it != events.end(); ++it)
- dispatchEvent((*it).release());
+ for (auto& event : events)
+ dispatchEvent(event.release());
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -320,11 +320,8 @@
Vector<RefPtr<Event>> events;
events.swap(m_scheduledEvents);
- Vector<RefPtr<Event>>::iterator it = events.begin();
- for (; it != events.end(); ++it)
- dispatchEvent((*it).release());
-
- events.clear();
+ for (auto& event : events)
+ dispatchEvent(event.release());
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -95,8 +95,8 @@
return INVALID_ACCESS_ERR;
if (urlString.find(',') != notFound && iceServer.get("urls", urlsList) && urlsList.size()) {
- for (auto iter = urlsList.begin(); iter != urlsList.end(); ++iter) {
- if (!validateIceServerURL(*iter))
+ for (auto& url : urlsList) {
+ if (!validateIceServerURL(url))
return INVALID_ACCESS_ERR;
}
} else {
@@ -203,8 +203,8 @@
{
stop();
- for (auto stream = m_localStreams.begin(), end = m_localStreams.end(); stream != end; ++stream)
- (*stream)->removeObserver(this);
+ for (auto& localStream : m_localStreams)
+ localStream->removeObserver(this);
}
void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& offerOptions, ExceptionCode& ec)
@@ -514,14 +514,14 @@
MediaStream* RTCPeerConnection::getStreamById(const String& streamId)
{
- for (auto iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) {
- if ((*iter)->id() == streamId)
- return iter->get();
+ for (auto& localStream : m_localStreams) {
+ if (localStream->id() == streamId)
+ return localStream.get();
}
- for (auto iter = m_remoteStreams.begin(); iter != m_remoteStreams.end(); ++iter) {
- if ((*iter)->id() == streamId)
- return iter->get();
+ for (auto& remoteStream : m_remoteStreams) {
+ if (remoteStream->id() == streamId)
+ return remoteStream.get();
}
return nullptr;
@@ -551,8 +551,8 @@
bool RTCPeerConnection::hasLocalStreamWithTrackId(const String& trackId)
{
- for (auto iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) {
- if ((*iter)->getTrackById(trackId))
+ for (auto& localStream : m_localStreams) {
+ if (localStream->getTrackById(trackId))
return true;
}
return false;
@@ -685,9 +685,8 @@
m_iceConnectionState = IceConnectionStateClosed;
m_signalingState = SignalingStateClosed;
- Vector<RefPtr<RTCDataChannel>>::iterator i = m_dataChannels.begin();
- for (; i != m_dataChannels.end(); ++i)
- (*i)->stop();
+ for (auto& channel : m_dataChannels)
+ channel->stop();
}
const char* RTCPeerConnection::activeDOMObjectName() const
@@ -743,9 +742,8 @@
Vector<RefPtr<Event>> events;
events.swap(m_scheduledEvents);
- Vector<RefPtr<Event>>::iterator it = events.begin();
- for (; it != events.end(); ++it)
- dispatchEvent((*it).release());
+ for (auto& event : events)
+ dispatchEvent(event.release());
events.clear();
}
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -48,9 +48,8 @@
Vector<String> RTCStatsReport::names() const
{
Vector<String> result;
- for (HashMap<String, String>::const_iterator it = m_stats.begin(); it != m_stats.end(); ++it) {
- result.append(it->key);
- }
+ for (auto& stat : m_stats.keys())
+ result.append(stat);
return result;
}
Modified: trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -44,29 +44,8 @@
static void initProtocolHandlerWhitelist()
{
protocolWhitelist = new HashSet<String>;
- static const char* protocols[] = {
- "bitcoin",
- "geo",
- "im",
- "irc",
- "ircs",
- "magnet",
- "mailto",
- "mms",
- "news",
- "nntp",
- "sip",
- "sms",
- "smsto",
- "ssh",
- "tel",
- "urn",
- "webcal",
- "wtai",
- "xmpp",
- };
- for (size_t i = 0; i < WTF_ARRAY_LENGTH(protocols); ++i)
- protocolWhitelist->add(protocols[i]);
+ for (auto* protocol : { "bitcoin", "geo", "im", "irc", "ircs", "magnet", "mailto", "mms", "news", "nntp", "sip", "sms", "smsto", "ssh", "tel", "urn", "webcal", "wtai", "xmpp" })
+ protocolWhitelist->add(protocol);
}
static bool verifyCustomHandlerURL(const URL& baseURL, const String& url, ExceptionCode& ec)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -74,10 +74,8 @@
m_platformSpeechSynthesizer = std::make_unique<PlatformSpeechSynthesizer>(this);
// If the voiceList is empty, that's the cue to get the voices from the platform again.
- const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& platformVoices = m_platformSpeechSynthesizer->voiceList();
- size_t voiceCount = platformVoices.size();
- for (size_t k = 0; k < voiceCount; k++)
- m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k]));
+ for (auto& voice : m_platformSpeechSynthesizer->voiceList())
+ m_voiceList.append(SpeechSynthesisVoice::create(voice));
return m_voiceList;
}
Modified: trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -125,8 +125,8 @@
size_t AudioBuffer::memoryCost() const
{
size_t cost = 0;
- for (unsigned i = 0; i < m_channels.size() ; ++i)
- cost += m_channels[i]->byteLength();
+ for (auto& channel : m_channels)
+ cost += channel->byteLength();
return cost;
}
Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -460,12 +460,11 @@
AudioSourceProvider* provider = 0;
- Vector<RefPtr<MediaStreamTrack>> audioTracks = mediaStream->getAudioTracks();
RefPtr<MediaStreamTrack> audioTrack;
// FIXME: get a provider for non-local MediaStreams (like from a remote peer).
- for (size_t i = 0; i < audioTracks.size(); ++i) {
- audioTrack = audioTracks[i];
+ for (auto& track : mediaStream->getAudioTracks()) {
+ audioTrack = track;
if (audioTrack->source()->isAudioStreamSource()) {
auto source = static_cast<MediaStreamAudioSource*>(audioTrack->source());
ASSERT(!source->deviceId().isEmpty());
@@ -664,8 +663,8 @@
{
ASSERT(isGraphOwner());
ASSERT(isAudioThread() || isAudioThreadFinished());
- for (unsigned i = 0; i < m_finishedNodes.size(); i++)
- derefNode(m_finishedNodes[i]);
+ for (auto& node : m_finishedNodes)
+ derefNode(node);
m_finishedNodes.clear();
}
@@ -692,8 +691,8 @@
void AudioContext::derefUnfinishedSourceNodes()
{
ASSERT(isMainThread() && isAudioThreadFinished());
- for (unsigned i = 0; i < m_referencedNodes.size(); ++i)
- m_referencedNodes[i]->deref(AudioNode::RefTypeConnection);
+ for (auto& node : m_referencedNodes)
+ node->deref(AudioNode::RefTypeConnection);
m_referencedNodes.clear();
}
@@ -825,10 +824,8 @@
void AudioContext::handleDeferredFinishDerefs()
{
ASSERT(isAudioThread() && isGraphOwner());
- for (unsigned i = 0; i < m_deferredFinishDerefList.size(); ++i) {
- AudioNode* node = m_deferredFinishDerefList[i];
+ for (auto& node : m_deferredFinishDerefList)
node->finishDeref(AudioNode::RefTypeConnection);
- }
m_deferredFinishDerefList.clear();
}
@@ -922,8 +919,8 @@
{
ASSERT(isGraphOwner());
- for (HashSet<AudioSummingJunction*>::iterator i = m_dirtySummingJunctions.begin(); i != m_dirtySummingJunctions.end(); ++i)
- (*i)->updateRenderingState();
+ for (auto& junction : m_dirtySummingJunctions)
+ junction->updateRenderingState();
m_dirtySummingJunctions.clear();
}
@@ -932,8 +929,8 @@
{
ASSERT(isGraphOwner());
- for (HashSet<AudioNodeOutput*>::iterator i = m_dirtyAudioNodeOutputs.begin(); i != m_dirtyAudioNodeOutputs.end(); ++i)
- (*i)->updateRenderingState();
+ for (auto& output : m_dirtyAudioNodeOutputs)
+ output->updateRenderingState();
m_dirtyAudioNodeOutputs.clear();
}
@@ -962,11 +959,9 @@
// Copy from m_automaticPullNodes to m_renderingAutomaticPullNodes.
m_renderingAutomaticPullNodes.resize(m_automaticPullNodes.size());
- unsigned j = 0;
- for (HashSet<AudioNode*>::iterator i = m_automaticPullNodes.begin(); i != m_automaticPullNodes.end(); ++i, ++j) {
- AudioNode* output = *i;
- m_renderingAutomaticPullNodes[j] = output;
- }
+ unsigned i = 0;
+ for (auto& output : m_automaticPullNodes)
+ m_renderingAutomaticPullNodes[i++] = output;
m_automaticPullNodesNeedUpdating = false;
}
@@ -976,8 +971,8 @@
{
ASSERT(isAudioThread());
- for (unsigned i = 0; i < m_renderingAutomaticPullNodes.size(); ++i)
- m_renderingAutomaticPullNodes[i]->processIfNecessary(framesToProcess);
+ for (auto& node : m_renderingAutomaticPullNodes)
+ node->processIfNecessary(framesToProcess);
}
ScriptExecutionContext* AudioContext::scriptExecutionContext() const
Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -277,8 +277,8 @@
void AudioNode::updateChannelsForInputs()
{
- for (unsigned i = 0; i < m_inputs.size(); ++i)
- input(i)->changedOutputs();
+ for (auto& input : m_inputs)
+ input->changedOutputs();
}
EventTargetInterface AudioNode::eventTargetInterface() const
@@ -325,7 +325,7 @@
{
ASSERT(context()->isAudioThread() && context()->isGraphOwner());
- for (const std::unique_ptr<AudioNodeInput>& savedInput : m_inputs) {
+ for (auto& savedInput : m_inputs) {
if (input == savedInput.get()) {
input->updateInternalBus();
return;
@@ -345,14 +345,14 @@
ASSERT(context()->isAudioThread());
// Process all of the AudioNodes connected to our inputs.
- for (unsigned i = 0; i < m_inputs.size(); ++i)
- input(i)->pull(0, framesToProcess);
+ for (auto& input : m_inputs)
+ input->pull(0, framesToProcess);
}
bool AudioNode::inputsAreSilent()
{
- for (unsigned i = 0; i < m_inputs.size(); ++i) {
- if (!input(i)->bus()->isSilent())
+ for (auto& input : m_inputs) {
+ if (!input->bus()->isSilent())
return false;
}
return true;
@@ -360,14 +360,14 @@
void AudioNode::silenceOutputs()
{
- for (unsigned i = 0; i < m_outputs.size(); ++i)
- output(i)->bus()->zero();
+ for (auto& output : m_outputs)
+ output->bus()->zero();
}
void AudioNode::unsilenceOutputs()
{
- for (unsigned i = 0; i < m_outputs.size(); ++i)
- output(i)->bus()->clearSilentFlag();
+ for (auto& output : m_outputs)
+ output->bus()->clearSilentFlag();
}
void AudioNode::enableOutputsIfNecessary()
@@ -377,8 +377,8 @@
AudioContext::AutoLocker locker(*context());
m_isDisabled = false;
- for (unsigned i = 0; i < m_outputs.size(); ++i)
- output(i)->enable();
+ for (auto& output : m_outputs)
+ output->enable();
}
}
@@ -402,8 +402,8 @@
// longer any active connections.
if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) {
m_isDisabled = true;
- for (unsigned i = 0; i < m_outputs.size(); ++i)
- output(i)->disable();
+ for (auto& output : m_outputs)
+ output->disable();
}
}
}
@@ -492,8 +492,8 @@
if (!m_normalRefCount) {
if (!m_isMarkedForDeletion) {
// All references are gone - we need to go away.
- for (unsigned i = 0; i < m_outputs.size(); ++i)
- output(i)->disconnectAll(); // This will deref() nodes we're connected to.
+ for (auto& output : m_outputs)
+ output->disconnectAll(); // This will deref() nodes we're connected to.
// Mark for deletion at end of each render quantum or when context shuts down.
context()->markForDeletion(this);
Modified: trunk/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -151,8 +151,7 @@
// Find the number of channels of the connection with the largest number of channels.
unsigned maxChannels = 1; // one channel is the minimum allowed
- for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i) {
- AudioNodeOutput* output = *i;
+ for (auto& output : m_outputs) {
// Use output()->numberOfChannels() instead of output->bus()->numberOfChannels(),
// because the calling of AudioNodeOutput::bus() is not safe here.
maxChannels = std::max(maxChannels, output->numberOfChannels());
@@ -198,8 +197,7 @@
AudioBus::ChannelInterpretation interpretation = node()->internalChannelInterpretation();
- for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) {
- AudioNodeOutput* output = renderingOutput(i);
+ for (auto& output : m_renderingOutputs) {
ASSERT(output);
// Render audio from this output.
Modified: trunk/Source/WebCore/Modules/webaudio/AudioNodeOutput.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioNodeOutput.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNodeOutput.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -98,8 +98,7 @@
if (isChannelCountKnown()) {
// Announce to any nodes we're connected to that we changed our channel count for its input.
- for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
- AudioNodeInput* input = *i;
+ for (auto& input : m_inputs) {
AudioNode* connectionNode = input->node();
connectionNode->checkNumberOfChannelsForInput(input);
}
@@ -230,10 +229,8 @@
ASSERT(context()->isGraphOwner());
if (m_isEnabled) {
- for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
- AudioNodeInput* input = *i;
+ for (auto& input : m_inputs)
input->disable(this);
- }
m_isEnabled = false;
}
}
@@ -243,10 +240,8 @@
ASSERT(context()->isGraphOwner());
if (!m_isEnabled) {
- for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
- AudioNodeInput* input = *i;
+ for (auto& input : m_inputs)
input->enable(this);
- }
m_isEnabled = true;
}
}
Modified: trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -139,8 +139,7 @@
RefPtr<AudioBus> summingBus = AudioBus::create(1, numberOfValues, false);
summingBus->setChannelMemory(0, values, numberOfValues);
- for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) {
- AudioNodeOutput* output = renderingOutput(i);
+ for (auto& output : m_renderingOutputs) {
ASSERT(output);
// Render audio from this output.
Modified: trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -84,15 +84,17 @@
unsigned i = 0;
float insertTime = event.time();
- for (i = 0; i < m_events.size(); ++i) {
+ for (auto& paramEvent : m_events) {
// Overwrite same event type and time.
- if (m_events[i].time() == insertTime && m_events[i].type() == event.type()) {
- m_events[i] = event;
+ if (paramEvent.time() == insertTime && paramEvent.type() == event.type()) {
+ paramEvent = event;
return;
}
- if (m_events[i].time() > insertTime)
+ if (paramEvent.time() > insertTime)
break;
+
+ ++i;
}
m_events.insert(i, event);
Modified: trunk/Source/WebCore/Modules/webaudio/AudioSummingJunction.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/AudioSummingJunction.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/AudioSummingJunction.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -62,10 +62,9 @@
if (m_renderingStateNeedUpdating && canUpdateState()) {
// Copy from m_outputs to m_renderingOutputs.
m_renderingOutputs.resize(m_outputs.size());
- unsigned j = 0;
- for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i, ++j) {
- AudioNodeOutput* output = *i;
- m_renderingOutputs[j] = output;
+ unsigned i = 0;
+ for (auto& output : m_outputs) {
+ m_renderingOutputs[i++] = output;
output->updateRenderingState();
}
Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -81,15 +81,15 @@
void MediaStreamAudioSource::setAudioFormat(size_t numberOfChannels, float sampleRate)
{
MutexLocker locker(m_audioConsumersLock);
- for (Vector<RefPtr<AudioDestinationConsumer>>::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
- (*it)->setFormat(numberOfChannels, sampleRate);
+ for (auto& consumer : m_audioConsumers)
+ consumer->setFormat(numberOfChannels, sampleRate);
}
void MediaStreamAudioSource::consumeAudio(AudioBus* bus, size_t numberOfFrames)
{
MutexLocker locker(m_audioConsumersLock);
- for (Vector<RefPtr<AudioDestinationConsumer>>::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
- (*it)->consumeAudio(bus, numberOfFrames);
+ for (auto& consumer : m_audioConsumers)
+ consumer->consumeAudio(bus, numberOfFrames);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -65,9 +65,9 @@
m_oversample = oversample;
if (oversample != OverSampleNone) {
- for (unsigned i = 0; i < m_kernels.size(); ++i) {
- WaveShaperDSPKernel* kernel = static_cast<WaveShaperDSPKernel*>(m_kernels[i].get());
- kernel->lazyInitializeOversampling();
+ for (auto& audioDSPKernel : m_kernels) {
+ WaveShaperDSPKernel& kernel = static_cast<WaveShaperDSPKernel&>(*audioDSPKernel);
+ kernel.lazyInitializeOversampling();
}
}
}
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -150,10 +150,10 @@
while (auto task = m_pausedQueue.tryGetMessage())
pausedTasks.append(WTF::move(task));
- for (unsigned i = 0; i < pausedTasks.size(); ++i) {
+ for (auto& pausedTask : pausedTasks) {
AutodrainedPool pool;
- std::unique_ptr<DatabaseTask> task(pausedTasks[i].release());
+ std::unique_ptr<DatabaseTask> task(pausedTask.release());
{
MutexLocker pausedLocker(m_pausedMutex);
if (m_paused) {
@@ -203,9 +203,8 @@
// As the call to close will modify the original set, we must take a copy to iterate over.
DatabaseSet openSetCopy;
openSetCopy.swap(m_openDatabaseSet);
- DatabaseSet::iterator end = openSetCopy.end();
- for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it)
- (*it).get()->close();
+ for (auto& openDatabase : openSetCopy)
+ openDatabase->close();
}
// Detach the thread so its resources are no longer of any concern to anyone else
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -338,20 +338,16 @@
if (!nameMap)
return;
- DatabaseNameMap::const_iterator dbNameMapEndIt = nameMap->end();
- for (DatabaseNameMap::const_iterator dbNameMapIt = nameMap->begin(); dbNameMapIt != dbNameMapEndIt; ++dbNameMapIt) {
- DatabaseSet* databaseSet = dbNameMapIt->value;
- DatabaseSet::const_iterator dbSetEndIt = databaseSet->end();
- for (DatabaseSet::const_iterator dbSetIt = databaseSet->begin(); dbSetIt != dbSetEndIt; ++dbSetIt) {
- if ((*dbSetIt)->databaseContext() == context)
- openDatabases.append(*dbSetIt);
+ for (auto& databaseSet : nameMap->values()) {
+ for (auto& database : *databaseSet) {
+ if (database->databaseContext() == context)
+ openDatabases.append(database);
}
}
}
- Vector<RefPtr<DatabaseBackendBase>>::const_iterator openDatabasesEndIt = openDatabases.end();
- for (Vector<RefPtr<DatabaseBackendBase>>::const_iterator openDatabasesIt = openDatabases.begin(); openDatabasesIt != openDatabasesEndIt; ++openDatabasesIt)
- (*openDatabasesIt)->interrupt();
+ for (auto& openDatabase : openDatabases)
+ openDatabase->interrupt();
}
String DatabaseTracker::originPath(SecurityOrigin* origin) const
@@ -482,8 +478,8 @@
return false;
}
- for (Vector<String>::iterator iter = temp.begin(); iter != temp.end(); ++iter)
- resultVector.append(iter->isolatedCopy());
+ for (auto& databaseName : temp)
+ resultVector.append(databaseName.isolatedCopy());
return true;
}
@@ -670,8 +666,8 @@
if (!databaseSet)
return;
- for (DatabaseSet::iterator it = databaseSet->begin(); it != databaseSet->end(); ++it)
- databases->add(*it);
+ for (auto& database : *databaseSet)
+ databases->add(database);
}
RefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
@@ -724,12 +720,9 @@
{
String originPath = this->originPath(origin);
unsigned long long diskUsage = 0;
- Vector<String> fileNames = listDirectory(originPath, String("*.db"));
- Vector<String>::iterator fileName = fileNames.begin();
- Vector<String>::iterator lastFileName = fileNames.end();
- for (; fileName != lastFileName; ++fileName) {
+ for (auto& fileName : listDirectory(originPath, ASCIILiteral("*.db"))) {
long long size;
- getFileSize(*fileName, size);
+ getFileSize(fileName, size);
diskUsage += size;
}
return diskUsage;
@@ -855,8 +848,8 @@
Vector<RefPtr<SecurityOrigin>> originsCopy;
origins(originsCopy);
- for (unsigned i = 0; i < originsCopy.size(); ++i)
- deleteOrigin(originsCopy[i].get());
+ for (auto& origin : originsCopy)
+ deleteOrigin(origin.get());
}
void DatabaseTracker::deleteDatabasesModifiedSince(std::chrono::system_clock::time_point time)
@@ -908,10 +901,10 @@
}
// We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
- for (unsigned i = 0; i < databaseNames.size(); ++i) {
- if (!deleteDatabaseFile(origin, databaseNames[i])) {
+ for (auto& name : databaseNames) {
+ if (!deleteDatabaseFile(origin, name)) {
// Even if the file can't be deleted, we want to try and delete the rest, don't return early here.
- LOG_ERROR("Unable to delete file for database %s in origin %s", databaseNames[i].ascii().data(), origin->databaseIdentifier().ascii().data());
+ LOG_ERROR("Unable to delete file for database %s in origin %s", name.ascii().data(), origin->databaseIdentifier().ascii().data());
}
}
@@ -973,8 +966,8 @@
#if PLATFORM(IOS)
m_client->dispatchDidDeleteDatabaseOrigin();
#endif
- for (unsigned i = 0; i < databaseNames.size(); ++i)
- m_client->dispatchDidModifyDatabase(origin, databaseNames[i]);
+ for (auto& name : databaseNames)
+ m_client->dispatchDidModifyDatabase(origin, name);
}
}
return true;
@@ -1178,16 +1171,15 @@
DatabaseSet* databaseSet = nameMap->get(name);
if (databaseSet && databaseSet->size()) {
// We have some database open with this name. Mark them as deleted.
- DatabaseSet::const_iterator end = databaseSet->end();
- for (DatabaseSet::const_iterator it = databaseSet->begin(); it != end; ++it)
- deletedDatabases.append(*it);
+ for (auto& database : *databaseSet)
+ deletedDatabases.append(database);
}
}
}
}
- for (unsigned i = 0; i < deletedDatabases.size(); ++i)
- deletedDatabases[i]->markAsDeletedAndClose();
+ for (auto& database : deletedDatabases)
+ database->markAsDeletedAndClose();
#if !PLATFORM(IOS)
return SQLiteFileSystem::deleteDatabaseFile(fullPath);
@@ -1230,17 +1222,15 @@
{
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (m_openDatabaseMap) {
- DatabaseOriginMap::const_iterator originMapEnd = m_openDatabaseMap->end();
- for (DatabaseOriginMap::const_iterator originMapIt = m_openDatabaseMap->begin(); originMapIt != originMapEnd; ++originMapIt) {
- RefPtr<SecurityOrigin> origin = originMapIt->key;
- DatabaseNameMap* databaseNameMap = originMapIt->value;
+ for (auto& openDatabase : *m_openDatabaseMap) {
+ auto& origin = openDatabase.key;
+ DatabaseNameMap* databaseNameMap = openDatabase.value;
Vector<String> deletedDatabaseNamesForThisOrigin;
// Loop through all opened databases in this origin. Get the current database file path of each database and see if
// it still matches the path stored in the opened database object.
- DatabaseNameMap::const_iterator dbNameMapEnd = databaseNameMap->end();
- for (DatabaseNameMap::const_iterator dbNameMapIt = databaseNameMap->begin(); dbNameMapIt != dbNameMapEnd; ++dbNameMapIt) {
- String databaseName = dbNameMapIt->key;
+ for (auto& databases : *databaseNameMap) {
+ String databaseName = databases.key;
String databaseFileName;
SQLiteStatement statement(m_database, "SELECT path FROM Databases WHERE origin=? AND name=?;");
if (statement.prepare() == SQLITE_OK) {
@@ -1252,11 +1242,7 @@
}
bool foundDeletedDatabase = false;
- DatabaseSet* databaseSet = dbNameMapIt->value;
- DatabaseSet::const_iterator dbEnd = databaseSet->end();
- for (DatabaseSet::const_iterator dbIt = databaseSet->begin(); dbIt != dbEnd; ++dbIt) {
- Database* db = static_cast<Database*>(*dbIt);
-
+ for (auto& db : *databases.value) {
// We are done if this database has already been marked as deleted.
if (db->deleted())
continue;
@@ -1279,19 +1265,18 @@
}
}
- for (unsigned i = 0; i < deletedDatabases.size(); ++i)
- deletedDatabases[i]->markAsDeletedAndClose();
-
- DeletedDatabaseMap::const_iterator end = deletedDatabaseMap.end();
- for (DeletedDatabaseMap::const_iterator it = deletedDatabaseMap.begin(); it != end; ++it) {
- SecurityOrigin* origin = it->key.get();
+ for (auto& deletedDatabase : deletedDatabases)
+ deletedDatabase->markAsDeletedAndClose();
+
+ for (auto& deletedDatabase : deletedDatabaseMap) {
+ SecurityOrigin* origin = deletedDatabase.key.get();
if (m_client)
m_client->dispatchDidModifyOrigin(origin);
- const Vector<String>& databaseNames = it->value;
- for (unsigned i = 0; i < databaseNames.size(); ++i) {
+ const Vector<String>& databaseNames = deletedDatabase.value;
+ for (auto& databaseName : databaseNames) {
if (m_client)
- m_client->dispatchDidModifyDatabase(origin, databaseNames[i]);
+ m_client->dispatchDidModifyDatabase(origin, databaseName);
}
}
}
@@ -1365,21 +1350,10 @@
// This walking is - sadly - the only reliable way to get at each open database thread.
// This will be cleaner once <rdar://problem/5680441> or some other DB thread consolidation takes place.
- DatabaseOriginMap::iterator i = m_openDatabaseMap.get()->begin();
- DatabaseOriginMap::iterator end = m_openDatabaseMap.get()->end();
-
- for (; i != end; ++i) {
- DatabaseNameMap* databaseNameMap = i->value;
- DatabaseNameMap::iterator j = databaseNameMap->begin();
- DatabaseNameMap::iterator dbNameMapEnd = databaseNameMap->end();
- for (; j != dbNameMapEnd; ++j) {
- DatabaseSet* databaseSet = j->value;
- DatabaseSet::iterator k = databaseSet->begin();
- DatabaseSet::iterator dbSetEnd = databaseSet->end();
- for (; k != dbSetEnd; ++k) {
- DatabaseContext* context = (*k)->databaseContext();
- context->setPaused(paused);
- }
+ for (auto& databaseNameMap : m_openDatabaseMap->values()) {
+ for (auto& databaseSet : databaseNameMap->values()) {
+ for (auto& database : *databaseSet)
+ database->databaseContext()->setPaused(paused);
}
}
}
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCoordinator.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCoordinator.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCoordinator.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -119,21 +119,14 @@
m_isShuttingDown = true;
// Notify all transactions in progress that the database thread is shutting down
- for (CoordinationInfoMap::iterator coordinationInfoIterator = m_coordinationInfoMap.begin();
- coordinationInfoIterator != m_coordinationInfoMap.end(); ++coordinationInfoIterator) {
- CoordinationInfo& info = coordinationInfoIterator->value;
-
+ for (auto& info : m_coordinationInfoMap.values()) {
// Clean up transactions that have reached "lockAcquired":
// Transaction phase 4 cleanup. See comment on "What happens if a
// transaction is interrupted?" at the top of SQLTransactionBackend.cpp.
if (info.activeWriteTransaction)
info.activeWriteTransaction->notifyDatabaseThreadIsShuttingDown();
- for (HashSet<RefPtr<SQLTransactionBackend>>::iterator activeReadTransactionsIterator =
- info.activeReadTransactions.begin();
- activeReadTransactionsIterator != info.activeReadTransactions.end();
- ++activeReadTransactionsIterator) {
- (*activeReadTransactionsIterator)->notifyDatabaseThreadIsShuttingDown();
- }
+ for (auto& transaction : info.activeReadTransactions)
+ transaction->notifyDatabaseThreadIsShuttingDown();
// Clean up transactions that have NOT reached "lockAcquired":
// Transaction phase 3 cleanup. See comment on "What happens if a
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -260,18 +260,18 @@
//
// Here, we throw SYNTAX_ERR if the given protocols do not meet the latter criteria. This behavior does not
// comply with WebSocket API specification, but it seems to be the only reasonable way to handle this conflict.
- for (size_t i = 0; i < protocols.size(); ++i) {
- if (!isValidProtocolString(protocols[i])) {
- scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, "Wrong protocol for WebSocket '" + encodeProtocolString(protocols[i]) + "'");
+ for (auto& protocol : protocols) {
+ if (!isValidProtocolString(protocol)) {
+ scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, "Wrong protocol for WebSocket '" + encodeProtocolString(protocol) + "'");
m_state = CLOSED;
ec = SYNTAX_ERR;
return;
}
}
HashSet<String> visited;
- for (size_t i = 0; i < protocols.size(); ++i) {
- if (!visited.add(protocols[i]).isNewEntry) {
- scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, "WebSocket protocols contain duplicates: '" + encodeProtocolString(protocols[i]) + "'");
+ for (auto& protocol : protocols) {
+ if (!visited.add(protocol).isNewEntry) {
+ scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, "WebSocket protocols contain duplicates: '" + encodeProtocolString(protocol) + "'");
m_state = CLOSED;
ec = SYNTAX_ERR;
return;
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketExtensionDispatcher.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/websockets/WebSocketExtensionDispatcher.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketExtensionDispatcher.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -50,8 +50,8 @@
void WebSocketExtensionDispatcher::addProcessor(std::unique_ptr<WebSocketExtensionProcessor> processor)
{
- for (size_t i = 0; i < m_processors.size(); ++i) {
- if (m_processors[i]->extensionToken() == processor->extensionToken())
+ for (auto& extensionProcessor : m_processors) {
+ if (extensionProcessor->extensionToken() == processor->extensionToken())
return;
}
ASSERT(processor->handshakeString().length());
@@ -81,12 +81,12 @@
m_acceptedExtensionsBuilder.appendLiteral(", ");
m_acceptedExtensionsBuilder.append(extensionToken);
// FIXME: Should use ListHashSet to keep the order of the parameters.
- for (HashMap<String, String>::const_iterator iterator = extensionParameters.begin(); iterator != extensionParameters.end(); ++iterator) {
+ for (auto& parameter : extensionParameters) {
m_acceptedExtensionsBuilder.appendLiteral("; ");
- m_acceptedExtensionsBuilder.append(iterator->key);
- if (!iterator->value.isNull()) {
+ m_acceptedExtensionsBuilder.append(parameter.key);
+ if (!parameter.value.isNull()) {
m_acceptedExtensionsBuilder.append('=');
- m_acceptedExtensionsBuilder.append(iterator->value);
+ m_acceptedExtensionsBuilder.append(parameter.value);
}
}
}
@@ -118,9 +118,8 @@
return false;
}
- size_t index;
- for (index = 0; index < m_processors.size(); ++index) {
- WebSocketExtensionProcessor* processor = m_processors[index].get();
+ size_t index = 0;
+ for (auto& processor : m_processors) {
if (extensionToken == processor->extensionToken()) {
if (processor->processResponse(extensionParameters)) {
appendAcceptedExtension(extensionToken, extensionParameters);
@@ -129,6 +128,7 @@
fail(processor->failureReason());
return false;
}
+ ++index;
}
// There is no extension which can process the response.
if (index == m_processors.size()) {
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (185315 => 185316)
--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp 2015-06-08 14:08:24 UTC (rev 185315)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp 2015-06-08 14:36:47 UTC (rev 185316)
@@ -224,8 +224,8 @@
// order is not meaningful. Thus, it's ok to send the order we constructed
// the fields.
- for (size_t i = 0; i < fields.size(); i++) {
- builder.append(fields[i]);
+ for (auto& field : fields) {
+ builder.append(field);
builder.appendLiteral("\r\n");
}