OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Computer, 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 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "platform/speech/PlatformSpeechSynthesizer.h" | 26 #include "platform/speech/PlatformSpeechSynthesizer.h" |
27 | 27 |
28 #include "platform/exported/WebSpeechSynthesizerClientImpl.h" | 28 #include "platform/exported/WebSpeechSynthesizerClientImpl.h" |
29 #include "platform/speech/PlatformSpeechSynthesisUtterance.h" | 29 #include "platform/speech/PlatformSpeechSynthesisUtterance.h" |
30 #include "public/platform/Platform.h" | 30 #include "public/platform/Platform.h" |
31 #include "public/platform/WebSpeechSynthesisUtterance.h" | 31 #include "public/platform/WebSpeechSynthesisUtterance.h" |
32 #include "public/platform/WebSpeechSynthesizer.h" | 32 #include "public/platform/WebSpeechSynthesizer.h" |
33 #include "public/platform/WebSpeechSynthesizerClient.h" | 33 #include "public/platform/WebSpeechSynthesizerClient.h" |
| 34 #include "wtf/PtrUtil.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 PlatformSpeechSynthesizer* PlatformSpeechSynthesizer::create(PlatformSpeechSynth
esizerClient* client) | 38 PlatformSpeechSynthesizer* PlatformSpeechSynthesizer::create(PlatformSpeechSynth
esizerClient* client) |
38 { | 39 { |
39 PlatformSpeechSynthesizer* synthesizer = new PlatformSpeechSynthesizer(clien
t); | 40 PlatformSpeechSynthesizer* synthesizer = new PlatformSpeechSynthesizer(clien
t); |
40 synthesizer->initializeVoiceList(); | 41 synthesizer->initializeVoiceList(); |
41 return synthesizer; | 42 return synthesizer; |
42 } | 43 } |
43 | 44 |
44 PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerCl
ient* client) | 45 PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerCl
ient* client) |
45 : m_speechSynthesizerClient(client) | 46 : m_speechSynthesizerClient(client) |
46 { | 47 { |
47 m_webSpeechSynthesizerClient = new WebSpeechSynthesizerClientImpl(this, clie
nt); | 48 m_webSpeechSynthesizerClient = new WebSpeechSynthesizerClientImpl(this, clie
nt); |
48 m_webSpeechSynthesizer = adoptPtr(Platform::current()->createSpeechSynthesiz
er(m_webSpeechSynthesizerClient)); | 49 m_webSpeechSynthesizer = wrapUnique(Platform::current()->createSpeechSynthes
izer(m_webSpeechSynthesizerClient)); |
49 } | 50 } |
50 | 51 |
51 PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer() | 52 PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer() |
52 { | 53 { |
53 } | 54 } |
54 | 55 |
55 void PlatformSpeechSynthesizer::speak(PlatformSpeechSynthesisUtterance* utteranc
e) | 56 void PlatformSpeechSynthesizer::speak(PlatformSpeechSynthesisUtterance* utteranc
e) |
56 { | 57 { |
57 if (m_webSpeechSynthesizer && m_webSpeechSynthesizerClient) | 58 if (m_webSpeechSynthesizer && m_webSpeechSynthesizerClient) |
58 m_webSpeechSynthesizer->speak(WebSpeechSynthesisUtterance(utterance)); | 59 m_webSpeechSynthesizer->speak(WebSpeechSynthesisUtterance(utterance)); |
(...skipping 28 matching lines...) Expand all Loading... |
87 m_webSpeechSynthesizer->updateVoiceList(); | 88 m_webSpeechSynthesizer->updateVoiceList(); |
88 } | 89 } |
89 | 90 |
90 DEFINE_TRACE(PlatformSpeechSynthesizer) | 91 DEFINE_TRACE(PlatformSpeechSynthesizer) |
91 { | 92 { |
92 visitor->trace(m_speechSynthesizerClient); | 93 visitor->trace(m_speechSynthesizerClient); |
93 visitor->trace(m_webSpeechSynthesizerClient); | 94 visitor->trace(m_webSpeechSynthesizerClient); |
94 } | 95 } |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
OLD | NEW |