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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3136 WriteParam(m, p.extension_apps); | 3136 WriteParam(m, p.extension_apps); |
3137 } | 3137 } |
3138 static bool Read(const Message* m, void** iter, param_type* p) { | 3138 static bool Read(const Message* m, void** iter, param_type* p) { |
3139 return ReadParam(m, iter, &p->extension_apps); | 3139 return ReadParam(m, iter, &p->extension_apps); |
3140 } | 3140 } |
3141 static void Log(const param_type& p, std::wstring* l) { | 3141 static void Log(const param_type& p, std::wstring* l) { |
3142 LogParam(p.extension_apps, l); | 3142 LogParam(p.extension_apps, l); |
3143 } | 3143 } |
3144 }; | 3144 }; |
3145 | 3145 |
| 3146 template<> |
| 3147 struct ParamTraits<appcache::AppCacheResourceInfo> { |
| 3148 typedef appcache::AppCacheResourceInfo param_type; |
| 3149 static void Write(Message* m, const param_type& p) { |
| 3150 WriteParam(m, p.url); |
| 3151 WriteParam(m, p.size); |
| 3152 WriteParam(m, p.is_manifest); |
| 3153 WriteParam(m, p.is_master); |
| 3154 WriteParam(m, p.is_fallback); |
| 3155 WriteParam(m, p.is_foreign); |
| 3156 WriteParam(m, p.is_explicit); |
| 3157 } |
| 3158 static bool Read(const Message* m, void** iter, param_type* p) { |
| 3159 return ReadParam(m, iter, &p->url) && |
| 3160 ReadParam(m, iter, &p->size) && |
| 3161 ReadParam(m, iter, &p->is_manifest) && |
| 3162 ReadParam(m, iter, &p->is_master) && |
| 3163 ReadParam(m, iter, &p->is_fallback) && |
| 3164 ReadParam(m, iter, &p->is_foreign) && |
| 3165 ReadParam(m, iter, &p->is_explicit); |
| 3166 } |
| 3167 static void Log(const param_type& p, std::wstring* l) { |
| 3168 l->append(L"("); |
| 3169 LogParam(p.url, l); |
| 3170 l->append(L", "); |
| 3171 LogParam(p.size, l); |
| 3172 l->append(L", "); |
| 3173 LogParam(p.is_manifest, l); |
| 3174 l->append(L", "); |
| 3175 LogParam(p.is_master, l); |
| 3176 l->append(L", "); |
| 3177 LogParam(p.is_fallback, l); |
| 3178 l->append(L", "); |
| 3179 LogParam(p.is_foreign, l); |
| 3180 l->append(L", "); |
| 3181 LogParam(p.is_explicit, l); |
| 3182 l->append(L")"); |
| 3183 } |
| 3184 }; |
| 3185 |
| 3186 template <> |
| 3187 struct ParamTraits<appcache::AppCacheInfo> { |
| 3188 typedef appcache::AppCacheInfo param_type; |
| 3189 static void Write(Message* m, const param_type& p) { |
| 3190 WriteParam(m, p.manifest_url); |
| 3191 WriteParam(m, p.creation_time); |
| 3192 WriteParam(m, p.last_update_time); |
| 3193 WriteParam(m, p.last_access_time); |
| 3194 WriteParam(m, p.cache_id); |
| 3195 WriteParam(m, p.status); |
| 3196 WriteParam(m, p.size); |
| 3197 WriteParam(m, p.is_complete); |
| 3198 } |
| 3199 static bool Read(const Message* m, void** iter, param_type* p) { |
| 3200 return ReadParam(m, iter, &p->manifest_url) && |
| 3201 ReadParam(m, iter, &p->creation_time) && |
| 3202 ReadParam(m, iter, &p->last_update_time) && |
| 3203 ReadParam(m, iter, &p->last_access_time) && |
| 3204 ReadParam(m, iter, &p->cache_id) && |
| 3205 ReadParam(m, iter, &p->status) && |
| 3206 ReadParam(m, iter, &p->size) && |
| 3207 ReadParam(m, iter, &p->is_complete); |
| 3208 } |
| 3209 static void Log(const param_type& p, std::wstring* l) { |
| 3210 l->append(L"("); |
| 3211 LogParam(p.manifest_url, l); |
| 3212 l->append(L", "); |
| 3213 LogParam(p.creation_time, l); |
| 3214 l->append(L", "); |
| 3215 LogParam(p.last_update_time, l); |
| 3216 l->append(L", "); |
| 3217 LogParam(p.last_access_time, l); |
| 3218 l->append(L", "); |
| 3219 LogParam(p.cache_id, l); |
| 3220 l->append(L", "); |
| 3221 LogParam(p.status, l); |
| 3222 l->append(L", "); |
| 3223 LogParam(p.size, l); |
| 3224 l->append(L")"); |
| 3225 LogParam(p.is_complete, l); |
| 3226 l->append(L", "); |
| 3227 } |
| 3228 }; |
| 3229 |
3146 template <> | 3230 template <> |
3147 struct ParamTraits<WindowContainerType> { | 3231 struct ParamTraits<WindowContainerType> { |
3148 typedef WindowContainerType param_type; | 3232 typedef WindowContainerType param_type; |
3149 static void Write(Message* m, const param_type& p) { | 3233 static void Write(Message* m, const param_type& p) { |
3150 int val = static_cast<int>(p); | 3234 int val = static_cast<int>(p); |
3151 WriteParam(m, val); | 3235 WriteParam(m, val); |
3152 } | 3236 } |
3153 static bool Read(const Message* m, void** iter, param_type* p) { | 3237 static bool Read(const Message* m, void** iter, param_type* p) { |
3154 int val = 0; | 3238 int val = 0; |
3155 if (!ReadParam(m, iter, &val) || | 3239 if (!ReadParam(m, iter, &val) || |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 l->append(L")"); | 3301 l->append(L")"); |
3218 } | 3302 } |
3219 }; | 3303 }; |
3220 | 3304 |
3221 } // namespace IPC | 3305 } // namespace IPC |
3222 | 3306 |
3223 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 3307 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
3224 #include "ipc/ipc_message_macros.h" | 3308 #include "ipc/ipc_message_macros.h" |
3225 | 3309 |
3226 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 3310 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
OLD | NEW |