OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 virtual void OnAudioLevelsChange(int session_id, | 50 virtual void OnAudioLevelsChange(int session_id, |
51 float volume, | 51 float volume, |
52 float noise_volume) OVERRIDE; | 52 float noise_volume) OVERRIDE; |
53 | 53 |
54 // BrowserMessageFilter implementation. | 54 // BrowserMessageFilter implementation. |
55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
56 virtual void OverrideThreadForMessage( | 56 virtual void OverrideThreadForMessage( |
57 const IPC::Message& message, | 57 const IPC::Message& message, |
58 BrowserThread::ID* thread) OVERRIDE; | 58 BrowserThread::ID* thread) OVERRIDE; |
59 | 59 |
60 virtual void OnChannelClosing() OVERRIDE; | 60 virtual void OnSenderClosing() OVERRIDE; |
61 | 61 |
62 private: | 62 private: |
63 virtual ~SpeechRecognitionDispatcherHost(); | 63 virtual ~SpeechRecognitionDispatcherHost(); |
64 | 64 |
65 void OnStartRequest( | 65 void OnStartRequest( |
66 const SpeechRecognitionHostMsg_StartRequest_Params& params); | 66 const SpeechRecognitionHostMsg_StartRequest_Params& params); |
67 void OnStartRequestOnIO( | 67 void OnStartRequestOnIO( |
68 int embedder_render_process_id, | 68 int embedder_render_process_id, |
69 int embedder_render_view_id, | 69 int embedder_render_view_id, |
70 const SpeechRecognitionHostMsg_StartRequest_Params& params, | 70 const SpeechRecognitionHostMsg_StartRequest_Params& params, |
71 bool filter_profanities); | 71 bool filter_profanities); |
72 void OnAbortRequest(int render_view_id, int request_id); | 72 void OnAbortRequest(int render_view_id, int request_id); |
73 void OnStopCaptureRequest(int render_view_id, int request_id); | 73 void OnStopCaptureRequest(int render_view_id, int request_id); |
74 | 74 |
75 int render_process_id_; | 75 int render_process_id_; |
76 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 76 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
77 | 77 |
78 // Used for posting asynchronous tasks (on the IO thread) without worrying | 78 // Used for posting asynchronous tasks (on the IO thread) without worrying |
79 // about this class being destroyed in the meanwhile (due to browser shutdown) | 79 // about this class being destroyed in the meanwhile (due to browser shutdown) |
80 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 80 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
81 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; | 81 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); | 83 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace content | 86 } // namespace content |
87 | 87 |
88 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 88 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
OLD | NEW |