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

Unified Diff: chrome/common/webkit_param_traits.h

Issue 3333008: Clean up webkit_param_traits.h to use SimilarTypeTraits for enums that don't... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/webkit_param_traits.h
===================================================================
--- chrome/common/webkit_param_traits.h (revision 57932)
+++ chrome/common/webkit_param_traits.h (working copy)
@@ -62,39 +62,13 @@
};
template <>
-struct ParamTraits<WebKit::WebConsoleMessage::Level> {
- typedef WebKit::WebConsoleMessage::Level param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, static_cast<int>(p));
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int value;
- if (!ReadParam(m, iter, &value))
- return false;
- *r = static_cast<param_type>(value);
- return true;
- }
- static void Log(const param_type& p, std::string* l) {
- LogParam(static_cast<int>(p), l);
- }
+struct SimilarTypeTraits<WebKit::WebConsoleMessage::Level> {
+ typedef int Type;
};
template <>
-struct ParamTraits<WebKit::WebPopupType> {
- typedef WebKit::WebPopupType param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, static_cast<int>(p));
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int value;
- if (!ReadParam(m, iter, &value))
- return false;
- *r = static_cast<param_type>(value);
- return true;
- }
- static void Log(const param_type& p, std::string* l) {
- LogParam(static_cast<int>(p), l);
- }
+struct SimilarTypeTraits<WebKit::WebPopupType> {
+ typedef int Type;
};
template <>
@@ -230,38 +204,13 @@
};
template <>
-struct ParamTraits<WebKit::WebTextDirection> {
- typedef WebKit::WebTextDirection param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, static_cast<int>(p));
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int value;
- if (!ReadParam(m, iter, &value))
- return false;
- *r = static_cast<param_type>(value);
- return true;
- }
- static void Log(const param_type& p, std::string* l) {
- LogParam(static_cast<int>(p), l);
- }
+struct SimilarTypeTraits<WebKit::WebTextDirection> {
+ typedef int Type;
};
template <>
-struct ParamTraits<WebKit::WebDragOperation> {
- typedef WebKit::WebDragOperation param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteInt(p);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int temp;
- bool res = m->ReadInt(iter, &temp);
- *r = static_cast<param_type>(temp);
- return res;
- }
- static void Log(const param_type& p, std::string* l) {
- l->append(StringPrintf("%d", p));
- }
+struct SimilarTypeTraits<WebKit::WebDragOperation> {
+ typedef int Type;
};
template <>
@@ -273,17 +222,8 @@
};
template <>
- struct ParamTraits<WebKit::WebContextMenuData::MediaType> {
- typedef WebKit::WebContextMenuData::MediaType param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteInt(p);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int temp;
- bool res = m->ReadInt(iter, &temp);
- *r = static_cast<param_type>(temp);
- return res;
- }
+struct SimilarTypeTraits<WebKit::WebContextMenuData::MediaType> {
+ typedef int Type;
};
template <>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698