Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/common/webkit_param_traits.h" | 5 #include "chrome/common/webkit_param_traits.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 LogParam(p.startOffset, l); | 168 LogParam(p.startOffset, l); |
| 169 l->append(","); | 169 l->append(","); |
| 170 LogParam(p.endOffset, l); | 170 LogParam(p.endOffset, l); |
| 171 l->append(":"); | 171 l->append(":"); |
| 172 LogParam(p.color, l); | 172 LogParam(p.color, l); |
| 173 l->append(":"); | 173 l->append(":"); |
| 174 LogParam(p.thick, l); | 174 LogParam(p.thick, l); |
| 175 l->append(")"); | 175 l->append(")"); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void ParamTraits<WebKit::WebTextCheckingResult>::Write(Message* m, | |
| 179 const param_type& p) { | |
| 180 WriteParam(m, static_cast<int>(p.error())); | |
| 181 WriteParam(m, p.position()); | |
| 182 WriteParam(m, p.length()); | |
| 183 } | |
| 184 | |
| 185 bool ParamTraits<WebKit::WebTextCheckingResult>::Read(const Message* m, | |
| 186 void** iter, | |
| 187 param_type* p) { | |
| 188 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.
| |
| 189 if (!ReadParam(m, iter, &error)) | |
| 190 return false; | |
| 191 if (error != WebKit::WebTextCheckingResult::ErrorSpelling && | |
| 192 error != WebKit::WebTextCheckingResult::ErrorGrammar) | |
| 193 return false; | |
| 194 int position; | |
|
pink (ping after 24hrs)
2011/02/11 17:33:40
init to 0
gmorrita
2011/02/17 11:39:44
Done.
| |
| 195 if (!ReadParam(m, iter, &position)) | |
| 196 return false; | |
| 197 int length; | |
|
pink (ping after 24hrs)
2011/02/11 17:33:40
init to 0
gmorrita
2011/02/17 11:39:44
Done.
| |
| 198 if (!ReadParam(m, iter, &length)) | |
| 199 return false; | |
| 200 | |
| 201 *p = WebKit::WebTextCheckingResult( | |
| 202 static_cast<WebKit::WebTextCheckingResult::Error>(error), | |
| 203 position, | |
| 204 length); | |
| 205 return true; | |
| 206 } | |
| 207 | |
| 208 void ParamTraits<WebKit::WebTextCheckingResult>::Log(const param_type& p, | |
| 209 std::string* l) { | |
| 210 l->append("("); | |
| 211 LogParam(static_cast<int>(p.error()), l); | |
| 212 l->append(", "); | |
| 213 LogParam(p.position(), l); | |
| 214 l->append(", "); | |
| 215 LogParam(p.length(), l); | |
| 216 l->append(")"); | |
| 217 } | |
| 218 | |
| 178 } // namespace IPC | 219 } // namespace IPC |
| OLD | NEW |