| 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 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 IPC_STRUCT_TRAITS_MEMBER(url) | 42 IPC_STRUCT_TRAITS_MEMBER(url) |
| 43 IPC_STRUCT_TRAITS_MEMBER(weight) | 43 IPC_STRUCT_TRAITS_MEMBER(weight) |
| 44 IPC_STRUCT_TRAITS_END() | 44 IPC_STRUCT_TRAITS_END() |
| 45 | 45 |
| 46 // ------- Messages for Speech JS APIs (SpeechRecognitionDispatcher) ---------- | 46 // ------- Messages for Speech JS APIs (SpeechRecognitionDispatcher) ---------- |
| 47 | 47 |
| 48 // Renderer -> Browser messages. | 48 // Renderer -> Browser messages. |
| 49 | 49 |
| 50 // Used to start a speech recognition session. | 50 // Used to start a speech recognition session. |
| 51 IPC_STRUCT_BEGIN(SpeechRecognitionHostMsg_StartRequest_Params) | 51 IPC_STRUCT_BEGIN(SpeechRecognitionHostMsg_StartRequest_Params) |
| 52 // The render view requesting speech recognition. | 52 // The render frame requesting speech recognition. |
| 53 IPC_STRUCT_MEMBER(int, render_view_id) | 53 IPC_STRUCT_MEMBER(int, render_frame_id) |
| 54 // Unique ID associated with the JS object making the calls. | 54 // Unique ID associated with the JS object making the calls. |
| 55 IPC_STRUCT_MEMBER(int, request_id) | 55 IPC_STRUCT_MEMBER(int, request_id) |
| 56 // Language to use for speech recognition. | 56 // Language to use for speech recognition. |
| 57 IPC_STRUCT_MEMBER(std::string, language) | 57 IPC_STRUCT_MEMBER(std::string, language) |
| 58 // Speech grammars to use. | 58 // Speech grammars to use. |
| 59 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) | 59 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) |
| 60 // URL of the page (or iframe if applicable). | 60 // URL of the page (or iframe if applicable). |
| 61 IPC_STRUCT_MEMBER(std::string, origin_url) | 61 IPC_STRUCT_MEMBER(std::string, origin_url) |
| 62 // Maximum number of hypotheses allowed for each results. | 62 // Maximum number of hypotheses allowed for each results. |
| 63 IPC_STRUCT_MEMBER(uint32, max_hypotheses) | 63 IPC_STRUCT_MEMBER(uint32, max_hypotheses) |
| 64 // Whether the user requested continuous recognition or not. | 64 // Whether the user requested continuous recognition or not. |
| 65 IPC_STRUCT_MEMBER(bool, continuous) | 65 IPC_STRUCT_MEMBER(bool, continuous) |
| 66 // Whether the user requested interim results or not. | 66 // Whether the user requested interim results or not. |
| 67 IPC_STRUCT_MEMBER(bool, interim_results) | 67 IPC_STRUCT_MEMBER(bool, interim_results) |
| 68 // Wheter the user has set an audio track as input or not. | 68 // Wheter the user has set an audio track as input or not. |
| 69 IPC_STRUCT_MEMBER(bool, using_audio_track) | 69 IPC_STRUCT_MEMBER(bool, using_audio_track) |
| 70 IPC_STRUCT_END() | 70 IPC_STRUCT_END() |
| 71 | 71 |
| 72 | 72 |
| 73 // Requests the speech recognition service to start speech recognition. | 73 // Requests the speech recognition service to start speech recognition. |
| 74 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_StartRequest, | 74 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_StartRequest, |
| 75 SpeechRecognitionHostMsg_StartRequest_Params) | 75 SpeechRecognitionHostMsg_StartRequest_Params) |
| 76 | 76 |
| 77 // Requests the speech recognition service to abort speech recognition on | 77 // Requests the speech recognition service to abort speech recognition |
| 78 // behalf of the given |render_view_id| and |request_id|. If there are no | 78 // associated with |request_id|. If there are no sessions associated with the |
| 79 // sessions associated with the |request_id| in the render view, this call | 79 // |request_id| in the render frame, this call does nothing. |
| 80 // does nothing. | |
| 81 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_AbortRequest, | 80 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_AbortRequest, |
| 82 int /* render_view_id */, | 81 int /* request_id */, |
| 83 int /* request_id */) | 82 int /* render_frame_id */) |
| 84 | 83 |
| 85 // Requests the speech recognition service to abort all speech recognitions on | 84 // Requests the speech recognition service to abort all speech recognitions |
| 86 // behalf of the given |render_view_id|. If speech recognition is not happening | 85 // running for the frame. If speech recognition is not happening for that frame, |
| 87 // or is happening on behalf of some other render view, this call does nothing. | 86 // this call does nothing. |
| 88 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_AbortAllRequests, | 87 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_AbortAllRequests, |
| 89 int /* render_view_id */) | 88 int /* render_frame_id */) |
| 90 | 89 |
| 91 // Requests the speech recognition service to stop audio capture on behalf of | 90 // Requests the speech recognition service to stop audio capture associated with |
| 92 // the given |render_view_id|. Any audio recorded so far will be fed to the | 91 // |request_id|. Any audio recorded so far will be fed to the speech recognizer. |
| 93 // speech recognizer. If speech recognition is not happening nor or is | 92 // If there are no sessions associated with |request_id|, this call does |
| 94 // happening on behalf of some other render view, this call does nothing. | 93 // nothing. |
| 95 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_StopCaptureRequest, | 94 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_StopCaptureRequest, |
| 96 int /* render_view_id */, | 95 int /* request_id */, |
| 97 int /* request_id */) | 96 int /* render_frame_id */) |
| 98 | 97 |
| 99 // Browser -> Renderer messages. | 98 // Browser -> Renderer messages. |
| 100 | 99 |
| 101 // The messages below follow exactly the same semantic of the corresponding | 100 // The messages below follow exactly the same semantic of the corresponding |
| 102 // events defined in content/public/browser/speech_recognition_event_listener.h. | 101 // events defined in content/public/browser/speech_recognition_event_listener.h. |
| 103 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ResultRetrieved, | 102 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ResultRetrieved, |
| 104 int /* request_id */, | 103 int /* request_id */, |
| 105 content::SpeechRecognitionResults /* results */) | 104 content::SpeechRecognitionResults /* results */) |
| 106 | 105 |
| 107 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ErrorOccurred, | 106 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ErrorOccurred, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 118 | 117 |
| 119 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) | 118 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) |
| 120 | 119 |
| 121 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) | 120 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) |
| 122 | 121 |
| 123 IPC_MESSAGE_ROUTED4(SpeechRecognitionMsg_AudioReceiverReady, | 122 IPC_MESSAGE_ROUTED4(SpeechRecognitionMsg_AudioReceiverReady, |
| 124 int /* request_id */, | 123 int /* request_id */, |
| 125 media::AudioParameters /* params */, | 124 media::AudioParameters /* params */, |
| 126 base::SharedMemoryHandle /* memory */, | 125 base::SharedMemoryHandle /* memory */, |
| 127 base::SyncSocket::TransitDescriptor /* socket */) | 126 base::SyncSocket::TransitDescriptor /* socket */) |
| OLD | NEW |