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

Side by Side Diff: third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "platform/speech/PlatformSpeechSynthesizer.h" 26 #include "platform/speech/PlatformSpeechSynthesizer.h"
27 27
28 #include "platform/exported/WebSpeechSynthesizerClientImpl.h" 28 #include "platform/exported/WebSpeechSynthesizerClientImpl.h"
29 #include "platform/speech/PlatformSpeechSynthesisUtterance.h" 29 #include "platform/speech/PlatformSpeechSynthesisUtterance.h"
30 #include "public/platform/Platform.h" 30 #include "public/platform/Platform.h"
31 #include "public/platform/WebSpeechSynthesisUtterance.h" 31 #include "public/platform/WebSpeechSynthesisUtterance.h"
32 #include "public/platform/WebSpeechSynthesizer.h" 32 #include "public/platform/WebSpeechSynthesizer.h"
33 #include "public/platform/WebSpeechSynthesizerClient.h" 33 #include "public/platform/WebSpeechSynthesizerClient.h"
34 #include "wtf/PtrUtil.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
38 PlatformSpeechSynthesizer* PlatformSpeechSynthesizer::create(PlatformSpeechSynth esizerClient* client) 37 PlatformSpeechSynthesizer* PlatformSpeechSynthesizer::create(PlatformSpeechSynth esizerClient* client)
39 { 38 {
40 PlatformSpeechSynthesizer* synthesizer = new PlatformSpeechSynthesizer(clien t); 39 PlatformSpeechSynthesizer* synthesizer = new PlatformSpeechSynthesizer(clien t);
41 synthesizer->initializeVoiceList(); 40 synthesizer->initializeVoiceList();
42 return synthesizer; 41 return synthesizer;
43 } 42 }
44 43
45 PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerCl ient* client) 44 PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerCl ient* client)
46 : m_speechSynthesizerClient(client) 45 : m_speechSynthesizerClient(client)
47 { 46 {
48 m_webSpeechSynthesizerClient = new WebSpeechSynthesizerClientImpl(this, clie nt); 47 m_webSpeechSynthesizerClient = new WebSpeechSynthesizerClientImpl(this, clie nt);
49 m_webSpeechSynthesizer = wrapUnique(Platform::current()->createSpeechSynthes izer(m_webSpeechSynthesizerClient)); 48 m_webSpeechSynthesizer = adoptPtr(Platform::current()->createSpeechSynthesiz er(m_webSpeechSynthesizerClient));
50 } 49 }
51 50
52 PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer() 51 PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
53 { 52 {
54 } 53 }
55 54
56 void PlatformSpeechSynthesizer::speak(PlatformSpeechSynthesisUtterance* utteranc e) 55 void PlatformSpeechSynthesizer::speak(PlatformSpeechSynthesisUtterance* utteranc e)
57 { 56 {
58 if (m_webSpeechSynthesizer && m_webSpeechSynthesizerClient) 57 if (m_webSpeechSynthesizer && m_webSpeechSynthesizerClient)
59 m_webSpeechSynthesizer->speak(WebSpeechSynthesisUtterance(utterance)); 58 m_webSpeechSynthesizer->speak(WebSpeechSynthesisUtterance(utterance));
(...skipping 28 matching lines...) Expand all
88 m_webSpeechSynthesizer->updateVoiceList(); 87 m_webSpeechSynthesizer->updateVoiceList();
89 } 88 }
90 89
91 DEFINE_TRACE(PlatformSpeechSynthesizer) 90 DEFINE_TRACE(PlatformSpeechSynthesizer)
92 { 91 {
93 visitor->trace(m_speechSynthesizerClient); 92 visitor->trace(m_speechSynthesizerClient);
94 visitor->trace(m_webSpeechSynthesizerClient); 93 visitor->trace(m_webSpeechSynthesizerClient);
95 } 94 }
96 95
97 } // namespace blink 96 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698