Chromium Code Reviews| 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" | |
|
jam
2011/01/19 20:29:23
the above two lines should be after all other incl
Satish
2011/01/20 11:04:12
Removed speech_input_result.h as suggested
| |
| 9 #include "chrome/common/speech_input_result.h" | |
| 10 | |
| 11 SpeechInputHostMsg_StartRecognition_Params:: | |
| 12 SpeechInputHostMsg_StartRecognition_Params() | |
| 13 : render_view_id(0), | |
| 14 request_id(0) { | |
| 15 } | |
| 16 | |
| 17 SpeechInputHostMsg_StartRecognition_Params:: | |
| 18 ~SpeechInputHostMsg_StartRecognition_Params() { | |
| 19 } | |
| 20 | |
| 21 namespace IPC { | |
| 22 | |
| 23 void ParamTraits<speech_input::SpeechInputResultItem>::Write( | |
| 24 Message* m, const param_type& p) { | |
| 25 WriteParam(m, p.utterance); | |
| 26 WriteParam(m, p.confidence); | |
| 27 } | |
| 28 | |
| 29 bool ParamTraits<speech_input::SpeechInputResultItem>::Read(const Message* m, | |
| 30 void** iter, | |
| 31 param_type* p) { | |
| 32 return ReadParam(m, iter, &p->utterance) && | |
| 33 ReadParam(m, iter, &p->confidence); | |
| 34 } | |
| 35 | |
| 36 void ParamTraits<speech_input::SpeechInputResultItem>::Log(const param_type& p, | |
| 37 std::string* l) { | |
| 38 l->append("("); | |
| 39 LogParam(p.utterance, l); | |
| 40 l->append(":"); | |
| 41 LogParam(p.confidence, l); | |
| 42 l->append(")"); | |
| 43 } | |
| 44 | |
| 45 void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Write( | |
| 46 Message* m, | |
| 47 const param_type& p) { | |
| 48 WriteParam(m, p.render_view_id); | |
| 49 WriteParam(m, p.request_id); | |
| 50 WriteParam(m, p.element_rect); | |
| 51 WriteParam(m, p.language); | |
| 52 WriteParam(m, p.grammar); | |
| 53 WriteParam(m, p.origin_url); | |
| 54 } | |
| 55 | |
| 56 bool ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Read( | |
| 57 const Message* m, void** iter, param_type* p) { | |
| 58 return | |
| 59 ReadParam(m, iter, &p->render_view_id) && | |
| 60 ReadParam(m, iter, &p->request_id) && | |
| 61 ReadParam(m, iter, &p->element_rect) && | |
| 62 ReadParam(m, iter, &p->language) && | |
| 63 ReadParam(m, iter, &p->grammar) && | |
| 64 ReadParam(m, iter, &p->origin_url); | |
| 65 } | |
| 66 | |
| 67 void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Log( | |
| 68 const param_type& p, std::string* l) { | |
| 69 l->append("("); | |
| 70 LogParam(p.render_view_id, l); | |
| 71 l->append(", "); | |
| 72 LogParam(p.request_id, l); | |
| 73 l->append(", "); | |
| 74 LogParam(p.element_rect, l); | |
| 75 l->append(", "); | |
| 76 LogParam(p.language, l); | |
| 77 l->append(", "); | |
| 78 LogParam(p.grammar, l); | |
| 79 l->append(", "); | |
| 80 LogParam(p.origin_url, l); | |
| 81 l->append(")"); | |
| 82 } | |
| 83 | |
| 84 } // namespace IPC | |
| OLD | NEW |