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

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

Issue 1617383003: Move PlatformSpeechSynthesisVoice off the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix oilpan compilation Created 4 years, 11 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 | « no previous file | third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.h » ('j') | 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) 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) 60 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped())
61 dispatchEvent(Event::create(EventTypeNames::voiceschanged)); 61 dispatchEvent(Event::create(EventTypeNames::voiceschanged));
62 } 62 }
63 63
64 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() 64 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices()
65 { 65 {
66 if (m_voiceList.size()) 66 if (m_voiceList.size())
67 return m_voiceList; 67 return m_voiceList;
68 68
69 // If the voiceList is empty, that's the cue to get the voices from the plat form again. 69 // If the voiceList is empty, that's the cue to get the voices from the plat form again.
70 const HeapVector<Member<PlatformSpeechSynthesisVoice>>& platformVoices = m_p latformSpeechSynthesizer->voiceList(); 70 const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& platformVoices = m_platf ormSpeechSynthesizer->voiceList();
71 size_t voiceCount = platformVoices.size(); 71 size_t voiceCount = platformVoices.size();
72 for (size_t k = 0; k < voiceCount; k++) 72 for (size_t k = 0; k < voiceCount; k++)
73 m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k])); 73 m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k]));
74 74
75 return m_voiceList; 75 return m_voiceList;
76 } 76 }
77 77
78 bool SpeechSynthesis::speaking() const 78 bool SpeechSynthesis::speaking() const
79 { 79 {
80 // If we have a current speech utterance, then that means we're assumed to b e in a speaking state. 80 // If we have a current speech utterance, then that means we're assumed to b e in a speaking state.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 { 232 {
233 visitor->trace(m_platformSpeechSynthesizer); 233 visitor->trace(m_platformSpeechSynthesizer);
234 visitor->trace(m_voiceList); 234 visitor->trace(m_voiceList);
235 visitor->trace(m_utteranceQueue); 235 visitor->trace(m_utteranceQueue);
236 PlatformSpeechSynthesizerClient::trace(visitor); 236 PlatformSpeechSynthesizerClient::trace(visitor);
237 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace( visitor); 237 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace( visitor);
238 ContextLifecycleObserver::trace(visitor); 238 ContextLifecycleObserver::trace(visitor);
239 } 239 }
240 240
241 } // namespace blink 241 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698