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

Side by Side Diff: chrome/renderer/tts_dispatcher.h

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 years, 7 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
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_TTS_DISPATCHER_H_ 5 #ifndef CHROME_RENDERER_TTS_DISPATCHER_H_
6 #define CHROME_RENDERER_TTS_DISPATCHER_H_ 6 #define CHROME_RENDERER_TTS_DISPATCHER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 14 matching lines...) Expand all
25 // Each TtsDispatcher is owned by the WebSpeechSynthesizerClient in Blink; 25 // Each TtsDispatcher is owned by the WebSpeechSynthesizerClient in Blink;
26 // it registers itself to listen to IPC upon construction and unregisters 26 // it registers itself to listen to IPC upon construction and unregisters
27 // itself when deleted. There can be multiple TtsDispatchers alive at once, 27 // itself when deleted. There can be multiple TtsDispatchers alive at once,
28 // so each one routes IPC messages to its WebSpeechSynthesizerClient only if 28 // so each one routes IPC messages to its WebSpeechSynthesizerClient only if
29 // the utterance id (which is globally unique) matches. 29 // the utterance id (which is globally unique) matches.
30 class TtsDispatcher 30 class TtsDispatcher
31 : public blink::WebSpeechSynthesizer, 31 : public blink::WebSpeechSynthesizer,
32 public content::RenderThreadObserver { 32 public content::RenderThreadObserver {
33 public: 33 public:
34 explicit TtsDispatcher(blink::WebSpeechSynthesizerClient* client); 34 explicit TtsDispatcher(blink::WebSpeechSynthesizerClient* client);
35 ~TtsDispatcher() override;
35 36
36 private: 37 private:
37 ~TtsDispatcher() override;
38
39 // RenderThreadObserver override. 38 // RenderThreadObserver override.
40 bool OnControlMessageReceived(const IPC::Message& message) override; 39 bool OnControlMessageReceived(const IPC::Message& message) override;
41 40
42 // blink::WebSpeechSynthesizer implementation. 41 // blink::WebSpeechSynthesizer implementation.
43 void UpdateVoiceList() override; 42 void UpdateVoiceList() override;
44 void Speak(const blink::WebSpeechSynthesisUtterance& utterance) override; 43 void Speak(const blink::WebSpeechSynthesisUtterance& utterance) override;
45 void Pause() override; 44 void Pause() override;
46 void Resume() override; 45 void Resume() override;
47 void Cancel() override; 46 void Cancel() override;
48 47
(...skipping 19 matching lines...) Expand all
68 // Next utterance id, used to map response IPCs to utterance objects. 67 // Next utterance id, used to map response IPCs to utterance objects.
69 static int next_utterance_id_; 68 static int next_utterance_id_;
70 69
71 // Map from id to utterance objects. 70 // Map from id to utterance objects.
72 base::hash_map<int, blink::WebSpeechSynthesisUtterance> utterance_id_map_; 71 base::hash_map<int, blink::WebSpeechSynthesisUtterance> utterance_id_map_;
73 72
74 DISALLOW_COPY_AND_ASSIGN(TtsDispatcher); 73 DISALLOW_COPY_AND_ASSIGN(TtsDispatcher);
75 }; 74 };
76 75
77 #endif // CHROME_RENDERER_TTS_DISPATCHER_H_ 76 #endif // CHROME_RENDERER_TTS_DISPATCHER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698