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

Side by Side Diff: Source/platform/speech/PlatformSpeechSynthesizer.h

Issue 1148383012: Oilpan: prefer eager finalization over prefinalizers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 virtual void speakingErrorOccurred(PlatformSpeechSynthesisUtterance*) = 0; 51 virtual void speakingErrorOccurred(PlatformSpeechSynthesisUtterance*) = 0;
52 virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance*, Speech Boundary, unsigned charIndex) = 0; 52 virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance*, Speech Boundary, unsigned charIndex) = 0;
53 virtual void voicesDidChange() = 0; 53 virtual void voicesDidChange() = 0;
54 54
55 protected: 55 protected:
56 virtual ~PlatformSpeechSynthesizerClient() { } 56 virtual ~PlatformSpeechSynthesizerClient() { }
57 }; 57 };
58 58
59 class PLATFORM_EXPORT PlatformSpeechSynthesizer : public GarbageCollectedFinaliz ed<PlatformSpeechSynthesizer> { 59 class PLATFORM_EXPORT PlatformSpeechSynthesizer : public GarbageCollectedFinaliz ed<PlatformSpeechSynthesizer> {
60 WTF_MAKE_NONCOPYABLE(PlatformSpeechSynthesizer); 60 WTF_MAKE_NONCOPYABLE(PlatformSpeechSynthesizer);
61 USING_PRE_FINALIZER(PlatformSpeechSynthesizer, dispose);
62 public: 61 public:
63 static PlatformSpeechSynthesizer* create(PlatformSpeechSynthesizerClient*); 62 static PlatformSpeechSynthesizer* create(PlatformSpeechSynthesizerClient*);
64 63
65 virtual ~PlatformSpeechSynthesizer(); 64 virtual ~PlatformSpeechSynthesizer();
66 void dispose();
67 65
68 const HeapVector<Member<PlatformSpeechSynthesisVoice>>& voiceList() const { return m_voiceList; } 66 const HeapVector<Member<PlatformSpeechSynthesisVoice>>& voiceList() const { return m_voiceList; }
69 virtual void speak(PlatformSpeechSynthesisUtterance*); 67 virtual void speak(PlatformSpeechSynthesisUtterance*);
70 virtual void pause(); 68 virtual void pause();
71 virtual void resume(); 69 virtual void resume();
72 virtual void cancel(); 70 virtual void cancel();
73 71
74 PlatformSpeechSynthesizerClient* client() const { return m_speechSynthesizer Client; } 72 PlatformSpeechSynthesizerClient* client() const { return m_speechSynthesizer Client; }
75 73
76 void setVoiceList(HeapVector<Member<PlatformSpeechSynthesisVoice>>&); 74 void setVoiceList(HeapVector<Member<PlatformSpeechSynthesisVoice>>&);
77 75
76 // Eager finalization to promptly release owned WebSpeechSynthesizer.
77 EAGERLY_FINALIZE();
78 DECLARE_VIRTUAL_TRACE(); 78 DECLARE_VIRTUAL_TRACE();
79 79
80 protected: 80 protected:
81 explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*); 81 explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*);
82 82
83 virtual void initializeVoiceList(); 83 virtual void initializeVoiceList();
84 84
85 HeapVector<Member<PlatformSpeechSynthesisVoice>> m_voiceList; 85 HeapVector<Member<PlatformSpeechSynthesisVoice>> m_voiceList;
86 86
87 private: 87 private:
88 Member<PlatformSpeechSynthesizerClient> m_speechSynthesizerClient; 88 Member<PlatformSpeechSynthesizerClient> m_speechSynthesizerClient;
89 89
90 OwnPtr<WebSpeechSynthesizer> m_webSpeechSynthesizer; 90 OwnPtr<WebSpeechSynthesizer> m_webSpeechSynthesizer;
91 Member<WebSpeechSynthesizerClientImpl> m_webSpeechSynthesizerClient; 91 Member<WebSpeechSynthesizerClientImpl> m_webSpeechSynthesizerClient;
92 }; 92 };
93 93
94 } // namespace blink 94 } // namespace blink
95 95
96 #endif // PlatformSpeechSynthesizer_h 96 #endif // PlatformSpeechSynthesizer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698