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

Side by Side Diff: Source/modules/speech/SpeechSynthesisUtterance.cpp

Issue 339823003: Oilpan: move platform speech objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Trace SpeechRecognition's controller reference. Created 6 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
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 25 matching lines...) Expand all
36 SpeechSynthesisUtterance::SpeechSynthesisUtterance(ExecutionContext* context, co nst String& text) 36 SpeechSynthesisUtterance::SpeechSynthesisUtterance(ExecutionContext* context, co nst String& text)
37 : ContextLifecycleObserver(context) 37 : ContextLifecycleObserver(context)
38 , m_platformUtterance(PlatformSpeechSynthesisUtterance::create(this)) 38 , m_platformUtterance(PlatformSpeechSynthesisUtterance::create(this))
39 { 39 {
40 ScriptWrappable::init(this); 40 ScriptWrappable::init(this);
41 m_platformUtterance->setText(text); 41 m_platformUtterance->setText(text);
42 } 42 }
43 43
44 SpeechSynthesisUtterance::~SpeechSynthesisUtterance() 44 SpeechSynthesisUtterance::~SpeechSynthesisUtterance()
45 { 45 {
46 m_platformUtterance->setClient(0);
47 } 46 }
48 47
49 ExecutionContext* SpeechSynthesisUtterance::executionContext() const 48 ExecutionContext* SpeechSynthesisUtterance::executionContext() const
50 { 49 {
51 return ContextLifecycleObserver::executionContext(); 50 return ContextLifecycleObserver::executionContext();
52 } 51 }
53 52
54 const AtomicString& SpeechSynthesisUtterance::interfaceName() const 53 const AtomicString& SpeechSynthesisUtterance::interfaceName() const
55 { 54 {
56 return EventTargetNames::SpeechSynthesisUtterance; 55 return EventTargetNames::SpeechSynthesisUtterance;
57 } 56 }
58 57
59 SpeechSynthesisVoice* SpeechSynthesisUtterance::voice() const 58 SpeechSynthesisVoice* SpeechSynthesisUtterance::voice() const
60 { 59 {
61 return m_voice.get(); 60 return m_voice.get();
62 } 61 }
63 62
64 void SpeechSynthesisUtterance::setVoice(SpeechSynthesisVoice* voice) 63 void SpeechSynthesisUtterance::setVoice(SpeechSynthesisVoice* voice)
65 { 64 {
66 // Cache our own version of the SpeechSynthesisVoice so that we don't have t o do some lookup 65 // Cache our own version of the SpeechSynthesisVoice so that we don't have t o do some lookup
67 // to go from the platform voice back to the speech synthesis voice in the r ead property. 66 // to go from the platform voice back to the speech synthesis voice in the r ead property.
68 m_voice = voice; 67 m_voice = voice;
69 68
70 if (voice) 69 if (voice)
71 m_platformUtterance->setVoice(voice->platformVoice()); 70 m_platformUtterance->setVoice(voice->platformVoice());
72 } 71 }
73 72
74 void SpeechSynthesisUtterance::trace(Visitor* visitor) 73 void SpeechSynthesisUtterance::trace(Visitor* visitor)
75 { 74 {
75 visitor->trace(m_platformUtterance);
76 visitor->trace(m_voice); 76 visitor->trace(m_voice);
77 EventTargetWithInlineData::trace(visitor); 77 EventTargetWithInlineData::trace(visitor);
78 } 78 }
79 79
80 } // namespace WebCore 80 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/speech/SpeechSynthesisUtterance.h ('k') | Source/modules/speech/SpeechSynthesisVoice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698