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

Side by Side Diff: third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp

Issue 2749753002: Migrate WTF::Deque::removeFirst() to ::pop_front() (Closed)
Patch Set: Created 3 years, 9 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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 void SpeechSynthesis::handleSpeakingCompleted( 138 void SpeechSynthesis::handleSpeakingCompleted(
139 SpeechSynthesisUtterance* utterance, 139 SpeechSynthesisUtterance* utterance,
140 bool errorOccurred) { 140 bool errorOccurred) {
141 ASSERT(utterance); 141 ASSERT(utterance);
142 142
143 bool shouldStartSpeaking = false; 143 bool shouldStartSpeaking = false;
144 // If the utterance that completed was the one we're currently speaking, 144 // If the utterance that completed was the one we're currently speaking,
145 // remove it from the queue and start speaking the next one. 145 // remove it from the queue and start speaking the next one.
146 if (utterance == currentSpeechUtterance()) { 146 if (utterance == currentSpeechUtterance()) {
147 m_utteranceQueue.removeFirst(); 147 m_utteranceQueue.pop_front();
148 shouldStartSpeaking = !!m_utteranceQueue.size(); 148 shouldStartSpeaking = !!m_utteranceQueue.size();
149 } 149 }
150 150
151 // Always fire the event, because the platform may have asynchronously 151 // Always fire the event, because the platform may have asynchronously
152 // sent an event on an utterance before it got the message that we 152 // sent an event on an utterance before it got the message that we
153 // canceled it, and we should always report to the user what actually 153 // canceled it, and we should always report to the user what actually
154 // happened. 154 // happened.
155 fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, 155 fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end,
156 utterance, 0, String()); 156 utterance, 0, String());
157 157
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 DEFINE_TRACE(SpeechSynthesis) { 237 DEFINE_TRACE(SpeechSynthesis) {
238 visitor->trace(m_platformSpeechSynthesizer); 238 visitor->trace(m_platformSpeechSynthesizer);
239 visitor->trace(m_voiceList); 239 visitor->trace(m_voiceList);
240 visitor->trace(m_utteranceQueue); 240 visitor->trace(m_utteranceQueue);
241 PlatformSpeechSynthesizerClient::trace(visitor); 241 PlatformSpeechSynthesizerClient::trace(visitor);
242 ContextClient::trace(visitor); 242 ContextClient::trace(visitor);
243 EventTargetWithInlineData::trace(visitor); 243 EventTargetWithInlineData::trace(visitor);
244 } 244 }
245 245
246 } // namespace blink 246 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698