Chromium Code Reviews| Index: chrome/common/webkit_param_traits.cc |
| diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc |
| index 12c885ac08070e5572a3aa039fe47b5b56ef0bc5..928f9d35668e529865b2e8dca23d9fc997979d97 100644 |
| --- a/chrome/common/webkit_param_traits.cc |
| +++ b/chrome/common/webkit_param_traits.cc |
| @@ -175,4 +175,45 @@ void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p, |
| l->append(")"); |
| } |
| +void ParamTraits<WebKit::WebTextCheckingResult>::Write(Message* m, |
| + const param_type& p) { |
| + WriteParam(m, static_cast<int>(p.error())); |
| + WriteParam(m, p.position()); |
| + WriteParam(m, p.length()); |
| +} |
| + |
| +bool ParamTraits<WebKit::WebTextCheckingResult>::Read(const Message* m, |
| + void** iter, |
| + param_type* p) { |
| + int error; |
|
pink (ping after 24hrs)
2011/02/11 17:33:40
might as well be safe and initialize this to 0
gmorrita
2011/02/17 11:39:44
Done.
|
| + if (!ReadParam(m, iter, &error)) |
| + return false; |
| + if (error != WebKit::WebTextCheckingResult::ErrorSpelling && |
| + error != WebKit::WebTextCheckingResult::ErrorGrammar) |
| + return false; |
| + int position; |
|
pink (ping after 24hrs)
2011/02/11 17:33:40
init to 0
gmorrita
2011/02/17 11:39:44
Done.
|
| + if (!ReadParam(m, iter, &position)) |
| + return false; |
| + int length; |
|
pink (ping after 24hrs)
2011/02/11 17:33:40
init to 0
gmorrita
2011/02/17 11:39:44
Done.
|
| + if (!ReadParam(m, iter, &length)) |
| + return false; |
| + |
| + *p = WebKit::WebTextCheckingResult( |
| + static_cast<WebKit::WebTextCheckingResult::Error>(error), |
| + position, |
| + length); |
| + return true; |
| +} |
| + |
| +void ParamTraits<WebKit::WebTextCheckingResult>::Log(const param_type& p, |
| + std::string* l) { |
| + l->append("("); |
| + LogParam(static_cast<int>(p.error()), l); |
| + l->append(", "); |
| + LogParam(p.position(), l); |
| + l->append(", "); |
| + LogParam(p.length(), l); |
| + l->append(")"); |
| +} |
| + |
| } // namespace IPC |