Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: chrome/common/webkit_param_traits.cc

Issue 6392045: Integrating Mac OS Grammar checker into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated to ToT Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/webkit_param_traits.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..294ef5cb2304a0e1a9df3239c88c40bad1a9633f 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 = 0;
+ if (!ReadParam(m, iter, &error))
+ return false;
+ if (error != WebKit::WebTextCheckingResult::ErrorSpelling &&
+ error != WebKit::WebTextCheckingResult::ErrorGrammar)
+ return false;
+ int position = 0;
+ if (!ReadParam(m, iter, &position))
+ return false;
+ int length = 0;
+ 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
« no previous file with comments | « chrome/common/webkit_param_traits.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698