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

Side by Side Diff: Source/modules/speech/SpeechSynthesis.h

Issue 180553004: Fix use-after-free of m_currentSpeechUtterance. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix nullptr again? Created 6 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 // PlatformSpeechSynthesizerClient override methods. 75 // PlatformSpeechSynthesizerClient override methods.
76 virtual void voicesDidChange() OVERRIDE; 76 virtual void voicesDidChange() OVERRIDE;
77 virtual void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE; 77 virtual void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE;
78 virtual void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE; 78 virtual void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE;
79 virtual void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE; 79 virtual void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE;
80 virtual void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE; 80 virtual void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) OVERRIDE;
81 virtual void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtteran ce>) OVERRIDE; 81 virtual void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtteran ce>) OVERRIDE;
82 virtual void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtteran ce>, SpeechBoundary, unsigned charIndex) OVERRIDE; 82 virtual void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtteran ce>, SpeechBoundary, unsigned charIndex) OVERRIDE;
83 83
84 void startSpeakingImmediately(SpeechSynthesisUtterance*); 84 void startSpeakingImmediately();
85 void handleSpeakingCompleted(SpeechSynthesisUtterance*, bool errorOccurred); 85 void handleSpeakingCompleted(SpeechSynthesisUtterance*, bool errorOccurred);
86 void fireEvent(const AtomicString& type, SpeechSynthesisUtterance*, unsigned long charIndex, const String& name); 86 void fireEvent(const AtomicString& type, SpeechSynthesisUtterance*, unsigned long charIndex, const String& name);
87 87
88 // Returns the utterance at the front of the queue.
89 SpeechSynthesisUtterance* currentSpeechUtterance() const;
90
88 OwnPtr<PlatformSpeechSynthesizer> m_platformSpeechSynthesizer; 91 OwnPtr<PlatformSpeechSynthesizer> m_platformSpeechSynthesizer;
89 WillBeHeapVector<RefPtrWillBeMember<SpeechSynthesisVoice> > m_voiceList; 92 WillBeHeapVector<RefPtrWillBeMember<SpeechSynthesisVoice> > m_voiceList;
90 RawPtrWillBeMember<SpeechSynthesisUtterance> m_currentSpeechUtterance;
91 Deque<RefPtrWillBeMember<SpeechSynthesisUtterance> > m_utteranceQueue; 93 Deque<RefPtrWillBeMember<SpeechSynthesisUtterance> > m_utteranceQueue;
92 bool m_isPaused; 94 bool m_isPaused;
93 95
94 // EventTarget 96 // EventTarget
95 virtual const AtomicString& interfaceName() const OVERRIDE; 97 virtual const AtomicString& interfaceName() const OVERRIDE;
96 }; 98 };
97 99
98 } // namespace WebCore 100 } // namespace WebCore
99 101
100 #endif // SpeechSynthesisEvent_h 102 #endif // SpeechSynthesisEvent_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/speechsynthesis/speech-synthesis-cancel-twice-expected.txt ('k') | Source/modules/speech/SpeechSynthesis.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698