OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/common_param_traits.h" |
| 6 |
| 7 #define IPC_MESSAGE_IMPL |
| 8 #include "chrome/common/speech_input_messages.h" |
| 9 |
| 10 SpeechInputHostMsg_StartRecognition_Params:: |
| 11 SpeechInputHostMsg_StartRecognition_Params() |
| 12 : render_view_id(0), |
| 13 request_id(0) { |
| 14 } |
| 15 |
| 16 SpeechInputHostMsg_StartRecognition_Params:: |
| 17 ~SpeechInputHostMsg_StartRecognition_Params() { |
| 18 } |
| 19 |
| 20 namespace IPC { |
| 21 |
| 22 void ParamTraits<speech_input::SpeechInputResultItem>::Write( |
| 23 Message* m, const param_type& p) { |
| 24 WriteParam(m, p.utterance); |
| 25 WriteParam(m, p.confidence); |
| 26 } |
| 27 |
| 28 bool ParamTraits<speech_input::SpeechInputResultItem>::Read(const Message* m, |
| 29 void** iter, |
| 30 param_type* p) { |
| 31 return ReadParam(m, iter, &p->utterance) && |
| 32 ReadParam(m, iter, &p->confidence); |
| 33 } |
| 34 |
| 35 void ParamTraits<speech_input::SpeechInputResultItem>::Log(const param_type& p, |
| 36 std::string* l) { |
| 37 l->append("("); |
| 38 LogParam(p.utterance, l); |
| 39 l->append(":"); |
| 40 LogParam(p.confidence, l); |
| 41 l->append(")"); |
| 42 } |
| 43 |
| 44 void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Write( |
| 45 Message* m, |
| 46 const param_type& p) { |
| 47 WriteParam(m, p.render_view_id); |
| 48 WriteParam(m, p.request_id); |
| 49 WriteParam(m, p.element_rect); |
| 50 WriteParam(m, p.language); |
| 51 WriteParam(m, p.grammar); |
| 52 WriteParam(m, p.origin_url); |
| 53 } |
| 54 |
| 55 bool ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Read( |
| 56 const Message* m, void** iter, param_type* p) { |
| 57 return |
| 58 ReadParam(m, iter, &p->render_view_id) && |
| 59 ReadParam(m, iter, &p->request_id) && |
| 60 ReadParam(m, iter, &p->element_rect) && |
| 61 ReadParam(m, iter, &p->language) && |
| 62 ReadParam(m, iter, &p->grammar) && |
| 63 ReadParam(m, iter, &p->origin_url); |
| 64 } |
| 65 |
| 66 void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Log( |
| 67 const param_type& p, std::string* l) { |
| 68 l->append("("); |
| 69 LogParam(p.render_view_id, l); |
| 70 l->append(", "); |
| 71 LogParam(p.request_id, l); |
| 72 l->append(", "); |
| 73 LogParam(p.element_rect, l); |
| 74 l->append(", "); |
| 75 LogParam(p.language, l); |
| 76 l->append(", "); |
| 77 LogParam(p.grammar, l); |
| 78 l->append(", "); |
| 79 LogParam(p.origin_url, l); |
| 80 l->append(")"); |
| 81 } |
| 82 |
| 83 } // namespace IPC |
OLD | NEW |