| 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. | |
| 53 IPC_STRUCT_MEMBER(int, render_view_id) | |
| 54 // Unique ID associated with the JS object making the calls. | 52 // Unique ID associated with the JS object making the calls. |
| 55 IPC_STRUCT_MEMBER(int, request_id) | 53 IPC_STRUCT_MEMBER(int, request_id) |
| 56 // Language to use for speech recognition. | 54 // Language to use for speech recognition. |
| 57 IPC_STRUCT_MEMBER(std::string, language) | 55 IPC_STRUCT_MEMBER(std::string, language) |
| 58 // Speech grammars to use. | 56 // Speech grammars to use. |
| 59 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) | 57 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) |
| 60 // URL of the page (or iframe if applicable). | 58 // URL of the page (or iframe if applicable). |
| 61 IPC_STRUCT_MEMBER(std::string, origin_url) | 59 IPC_STRUCT_MEMBER(std::string, origin_url) |
| 62 // Maximum number of hypotheses allowed for each results. | 60 // Maximum number of hypotheses allowed for each results. |
| 63 IPC_STRUCT_MEMBER(uint32, max_hypotheses) | 61 IPC_STRUCT_MEMBER(uint32, max_hypotheses) |
| 64 // Whether the user requested continuous recognition or not. | 62 // Whether the user requested continuous recognition or not. |
| 65 IPC_STRUCT_MEMBER(bool, continuous) | 63 IPC_STRUCT_MEMBER(bool, continuous) |
| 66 // Whether the user requested interim results or not. | 64 // Whether the user requested interim results or not. |
| 67 IPC_STRUCT_MEMBER(bool, interim_results) | 65 IPC_STRUCT_MEMBER(bool, interim_results) |
| 68 // Wheter the user has set an audio track as input or not. | 66 // Wheter the user has set an audio track as input or not. |
| 69 IPC_STRUCT_MEMBER(bool, using_audio_track) | 67 IPC_STRUCT_MEMBER(bool, using_audio_track) |
| 70 IPC_STRUCT_END() | 68 IPC_STRUCT_END() |
| 71 | 69 |
| 72 | 70 |
| 73 // Requests the speech recognition service to start speech recognition. | 71 // Requests the speech recognition service to start speech recognition. |
| 74 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_StartRequest, | 72 IPC_MESSAGE_ROUTED1(SpeechRecognitionHostMsg_StartRequest, |
| 75 SpeechRecognitionHostMsg_StartRequest_Params) | 73 SpeechRecognitionHostMsg_StartRequest_Params) |
| 76 | 74 |
| 77 // Requests the speech recognition service to abort speech recognition on | 75 // Requests the speech recognition service to abort speech recognition |
| 78 // behalf of the given |render_view_id| and |request_id|. If there are no | 76 // 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 | 77 // |request_id| in the render frame, this call does nothing. |
| 80 // does nothing. | 78 IPC_MESSAGE_ROUTED1(SpeechRecognitionHostMsg_AbortRequest, |
| 81 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_AbortRequest, | |
| 82 int /* render_view_id */, | |
| 83 int /* request_id */) | 79 int /* request_id */) |
| 84 | 80 |
| 85 // Requests the speech recognition service to abort all speech recognitions on | 81 // Requests the speech recognition service to abort all speech recognitions |
| 86 // behalf of the given |render_view_id|. If speech recognition is not happening | 82 // 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. | 83 // this call does nothing. |
| 88 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_AbortAllRequests, | 84 IPC_MESSAGE_ROUTED0(SpeechRecognitionHostMsg_AbortAllRequests) |
| 89 int /* render_view_id */) | |
| 90 | 85 |
| 91 // Requests the speech recognition service to stop audio capture on behalf of | 86 // 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 | 87 // |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 | 88 // 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. | 89 // nothing. |
| 95 IPC_MESSAGE_CONTROL2(SpeechRecognitionHostMsg_StopCaptureRequest, | 90 IPC_MESSAGE_ROUTED1(SpeechRecognitionHostMsg_StopCaptureRequest, |
| 96 int /* render_view_id */, | 91 int /* request_id */) |
| 97 int /* request_id */) | |
| 98 | 92 |
| 99 // Browser -> Renderer messages. | 93 // Browser -> Renderer messages. |
| 100 | 94 |
| 101 // The messages below follow exactly the same semantic of the corresponding | 95 // The messages below follow exactly the same semantic of the corresponding |
| 102 // events defined in content/public/browser/speech_recognition_event_listener.h. | 96 // events defined in content/public/browser/speech_recognition_event_listener.h. |
| 103 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ResultRetrieved, | 97 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ResultRetrieved, |
| 104 int /* request_id */, | 98 int /* request_id */, |
| 105 content::SpeechRecognitionResults /* results */) | 99 content::SpeechRecognitionResults /* results */) |
| 106 | 100 |
| 107 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ErrorOccurred, | 101 IPC_MESSAGE_ROUTED2(SpeechRecognitionMsg_ErrorOccurred, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 118 | 112 |
| 119 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) | 113 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) |
| 120 | 114 |
| 121 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) | 115 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) |
| 122 | 116 |
| 123 IPC_MESSAGE_ROUTED4(SpeechRecognitionMsg_AudioReceiverReady, | 117 IPC_MESSAGE_ROUTED4(SpeechRecognitionMsg_AudioReceiverReady, |
| 124 int /* request_id */, | 118 int /* request_id */, |
| 125 media::AudioParameters /* params */, | 119 media::AudioParameters /* params */, |
| 126 base::SharedMemoryHandle /* memory */, | 120 base::SharedMemoryHandle /* memory */, |
| 127 base::SyncSocket::TransitDescriptor /* socket */) | 121 base::SyncSocket::TransitDescriptor /* socket */) |
| OLD | NEW |