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

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

Issue 2595323002: Make use of ContextClient in modules/speech/ (Closed)
Patch Set: complete Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
30 namespace blink { 30 namespace blink {
31 31
32 SpeechSynthesisUtterance* SpeechSynthesisUtterance::create( 32 SpeechSynthesisUtterance* SpeechSynthesisUtterance::create(
33 ExecutionContext* context, 33 ExecutionContext* context,
34 const String& text) { 34 const String& text) {
35 return new SpeechSynthesisUtterance(context, text); 35 return new SpeechSynthesisUtterance(context, text);
36 } 36 }
37 37
38 SpeechSynthesisUtterance::SpeechSynthesisUtterance(ExecutionContext* context, 38 SpeechSynthesisUtterance::SpeechSynthesisUtterance(ExecutionContext* context,
39 const String& text) 39 const String& text)
40 : m_executionContext(context), 40 : ContextClient(context),
41 m_platformUtterance(PlatformSpeechSynthesisUtterance::create(this)) { 41 m_platformUtterance(PlatformSpeechSynthesisUtterance::create(this)) {
42 m_platformUtterance->setText(text); 42 m_platformUtterance->setText(text);
43 } 43 }
44 44
45 SpeechSynthesisUtterance::~SpeechSynthesisUtterance() {} 45 SpeechSynthesisUtterance::~SpeechSynthesisUtterance() {}
46 46
47 ExecutionContext* SpeechSynthesisUtterance::getExecutionContext() const {
48 return m_executionContext;
49 }
50
51 const AtomicString& SpeechSynthesisUtterance::interfaceName() const { 47 const AtomicString& SpeechSynthesisUtterance::interfaceName() const {
52 return EventTargetNames::SpeechSynthesisUtterance; 48 return EventTargetNames::SpeechSynthesisUtterance;
53 } 49 }
54 50
55 SpeechSynthesisVoice* SpeechSynthesisUtterance::voice() const { 51 SpeechSynthesisVoice* SpeechSynthesisUtterance::voice() const {
56 return m_voice; 52 return m_voice;
57 } 53 }
58 54
59 void SpeechSynthesisUtterance::setVoice(SpeechSynthesisVoice* voice) { 55 void SpeechSynthesisUtterance::setVoice(SpeechSynthesisVoice* voice) {
60 // Cache our own version of the SpeechSynthesisVoice so that we don't have to 56 // Cache our own version of the SpeechSynthesisVoice so that we don't have to
61 // do some lookup to go from the platform voice back to the speech synthesis 57 // do some lookup to go from the platform voice back to the speech synthesis
62 // voice in the read property. 58 // voice in the read property.
63 m_voice = voice; 59 m_voice = voice;
64 60
65 if (voice) 61 if (voice)
66 m_platformUtterance->setVoice(voice->platformVoice()); 62 m_platformUtterance->setVoice(voice->platformVoice());
67 } 63 }
68 64
69 DEFINE_TRACE(SpeechSynthesisUtterance) { 65 DEFINE_TRACE(SpeechSynthesisUtterance) {
70 visitor->trace(m_executionContext);
71 visitor->trace(m_platformUtterance); 66 visitor->trace(m_platformUtterance);
72 visitor->trace(m_voice); 67 visitor->trace(m_voice);
68 ContextClient::trace(visitor);
73 EventTargetWithInlineData::trace(visitor); 69 EventTargetWithInlineData::trace(visitor);
74 } 70 }
75 71
76 } // namespace blink 72 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698