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" | |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
10 | 9 |
11 namespace IPC { | 10 namespace IPC { |
12 | 11 |
13 void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) { | 12 void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) { |
14 WriteParam(m, p.x); | 13 WriteParam(m, p.x); |
15 WriteParam(m, p.y); | 14 WriteParam(m, p.y); |
16 WriteParam(m, p.width); | 15 WriteParam(m, p.width); |
17 WriteParam(m, p.height); | 16 WriteParam(m, p.height); |
18 } | 17 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 LogParam(p.availableRect, l); | 70 LogParam(p.availableRect, l); |
72 l->append(")"); | 71 l->append(")"); |
73 } | 72 } |
74 | 73 |
75 void ParamTraits<WebKit::WebCache::ResourceTypeStat>::Log( | 74 void ParamTraits<WebKit::WebCache::ResourceTypeStat>::Log( |
76 const param_type& p, std::string* l) { | 75 const param_type& p, std::string* l) { |
77 l->append(base::StringPrintf("%" PRIuS " %" PRIuS " %" PRIuS " %" PRIuS, | 76 l->append(base::StringPrintf("%" PRIuS " %" PRIuS " %" PRIuS " %" PRIuS, |
78 p.count, p.size, p.liveSize, p.decodedSize)); | 77 p.count, p.size, p.liveSize, p.decodedSize)); |
79 } | 78 } |
80 | 79 |
81 void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m, | |
82 const param_type& p) { | |
83 WriteParam(m, p.startOffset); | |
84 WriteParam(m, p.endOffset); | |
85 WriteParam(m, p.color); | |
86 WriteParam(m, p.thick); | |
87 } | |
88 | |
89 bool ParamTraits<WebKit::WebCompositionUnderline>::Read( | |
90 const Message* m, void** iter, | |
91 param_type* p) { | |
92 return | |
93 ReadParam(m, iter, &p->startOffset) && | |
94 ReadParam(m, iter, &p->endOffset) && | |
95 ReadParam(m, iter, &p->color) && | |
96 ReadParam(m, iter, &p->thick); | |
97 } | |
98 | |
99 void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p, | |
100 std::string* l) { | |
101 l->append("("); | |
102 LogParam(p.startOffset, l); | |
103 l->append(","); | |
104 LogParam(p.endOffset, l); | |
105 l->append(":"); | |
106 LogParam(p.color, l); | |
107 l->append(":"); | |
108 LogParam(p.thick, l); | |
109 l->append(")"); | |
110 } | |
111 | |
112 void ParamTraits<WebKit::WebTextCheckingResult>::Write(Message* m, | 80 void ParamTraits<WebKit::WebTextCheckingResult>::Write(Message* m, |
113 const param_type& p) { | 81 const param_type& p) { |
114 WriteParam(m, static_cast<int>(p.error())); | 82 WriteParam(m, static_cast<int>(p.error())); |
115 WriteParam(m, p.position()); | 83 WriteParam(m, p.position()); |
116 WriteParam(m, p.length()); | 84 WriteParam(m, p.length()); |
117 } | 85 } |
118 | 86 |
119 bool ParamTraits<WebKit::WebTextCheckingResult>::Read(const Message* m, | 87 bool ParamTraits<WebKit::WebTextCheckingResult>::Read(const Message* m, |
120 void** iter, | 88 void** iter, |
121 param_type* p) { | 89 param_type* p) { |
(...skipping 22 matching lines...) Expand all Loading... |
144 l->append("("); | 112 l->append("("); |
145 LogParam(static_cast<int>(p.error()), l); | 113 LogParam(static_cast<int>(p.error()), l); |
146 l->append(", "); | 114 l->append(", "); |
147 LogParam(p.position(), l); | 115 LogParam(p.position(), l); |
148 l->append(", "); | 116 l->append(", "); |
149 LogParam(p.length(), l); | 117 LogParam(p.length(), l); |
150 l->append(")"); | 118 l->append(")"); |
151 } | 119 } |
152 | 120 |
153 } // namespace IPC | 121 } // namespace IPC |
OLD | NEW |