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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 virtual void pause(); | 73 virtual void pause(); |
74 virtual void resume(); | 74 virtual void resume(); |
75 virtual void cancel(); | 75 virtual void cancel(); |
76 | 76 |
77 PlatformSpeechSynthesizerClient* client() const { | 77 PlatformSpeechSynthesizerClient* client() const { |
78 return m_speechSynthesizerClient; | 78 return m_speechSynthesizerClient; |
79 } | 79 } |
80 | 80 |
81 void setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice>>&); | 81 void setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice>>&); |
82 | 82 |
83 // Eager finalization is required to promptly release the owned WebSpeechSynth esizer. | 83 // Eager finalization is required to promptly release the owned |
84 // WebSpeechSynthesizer. | |
84 // | 85 // |
85 // If not and delayed until lazily swept, m_webSpeechSynthesizerClient may end up | 86 // If not and delayed until lazily swept, m_webSpeechSynthesizerClient may end |
86 // being lazily swept first (i.e., before this PlatformSpeechSynthesizer), lea ving | 87 // up |
Nico
2016/10/03 17:03:03
this needs lots of reflowing (hit gq a few times)
hans
2016/10/03 17:33:54
Done.
| |
88 // being lazily swept first (i.e., before this PlatformSpeechSynthesizer), | |
89 // leaving | |
87 // m_webSpeechSynthesizer with a dangling pointer to a finalized object -- | 90 // m_webSpeechSynthesizer with a dangling pointer to a finalized object -- |
88 // WebSpeechSynthesizer embedder implementations calling notification methods in the | 91 // WebSpeechSynthesizer embedder implementations calling notification methods |
92 // in the | |
89 // other directions by way of m_webSpeechSynthesizerClient. Eagerly releasing | 93 // other directions by way of m_webSpeechSynthesizerClient. Eagerly releasing |
90 // WebSpeechSynthesizer prevents such unsafe accesses. | 94 // WebSpeechSynthesizer prevents such unsafe accesses. |
91 EAGERLY_FINALIZE(); | 95 EAGERLY_FINALIZE(); |
92 DECLARE_VIRTUAL_TRACE(); | 96 DECLARE_VIRTUAL_TRACE(); |
93 | 97 |
94 protected: | 98 protected: |
95 explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*); | 99 explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*); |
96 | 100 |
97 virtual void initializeVoiceList(); | 101 virtual void initializeVoiceList(); |
98 | 102 |
99 Vector<RefPtr<PlatformSpeechSynthesisVoice>> m_voiceList; | 103 Vector<RefPtr<PlatformSpeechSynthesisVoice>> m_voiceList; |
100 | 104 |
101 private: | 105 private: |
102 Member<PlatformSpeechSynthesizerClient> m_speechSynthesizerClient; | 106 Member<PlatformSpeechSynthesizerClient> m_speechSynthesizerClient; |
103 | 107 |
104 std::unique_ptr<WebSpeechSynthesizer> m_webSpeechSynthesizer; | 108 std::unique_ptr<WebSpeechSynthesizer> m_webSpeechSynthesizer; |
105 Member<WebSpeechSynthesizerClientImpl> m_webSpeechSynthesizerClient; | 109 Member<WebSpeechSynthesizerClientImpl> m_webSpeechSynthesizerClient; |
106 }; | 110 }; |
107 | 111 |
108 } // namespace blink | 112 } // namespace blink |
109 | 113 |
110 #endif // PlatformSpeechSynthesizer_h | 114 #endif // PlatformSpeechSynthesizer_h |
OLD | NEW |