OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/extension_messages.h" | 5 #include "extensions/common/extension_messages.h" |
6 | 6 |
7 #include "content/public/common/common_param_traits.h" | 7 #include "content/public/common/common_param_traits.h" |
8 #include "extensions/common/extension.h" | 8 #include "extensions/common/extension.h" |
9 #include "extensions/common/manifest.h" | 9 #include "extensions/common/manifest.h" |
10 #include "extensions/common/manifest_handler.h" | 10 #include "extensions/common/manifest_handler.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 r->insert(p.release()); | 242 r->insert(p.release()); |
243 } | 243 } |
244 return true; | 244 return true; |
245 } | 245 } |
246 | 246 |
247 void ParamTraits<ManifestPermissionSet>::Log( | 247 void ParamTraits<ManifestPermissionSet>::Log( |
248 const param_type& p, std::string* l) { | 248 const param_type& p, std::string* l) { |
249 LogParam(p.map(), l); | 249 LogParam(p.map(), l); |
250 } | 250 } |
251 | 251 |
| 252 void ParamTraits<HostID>::Write( |
| 253 Message* m, const param_type& p) { |
| 254 WriteParam(m, p.type()); |
| 255 WriteParam(m, p.id()); |
| 256 } |
| 257 |
| 258 bool ParamTraits<HostID>::Read( |
| 259 const Message* m, PickleIterator* iter, param_type* r) { |
| 260 HostID::HostType type; |
| 261 std::string id; |
| 262 if (!ReadParam(m, iter, &type)) |
| 263 return false; |
| 264 if (!ReadParam(m, iter, &id)) |
| 265 return false; |
| 266 *r = HostID(type, id); |
| 267 return true; |
| 268 } |
| 269 |
| 270 void ParamTraits<HostID>::Log( |
| 271 const param_type& p, std::string* l) { |
| 272 LogParam(p.type(), l); |
| 273 LogParam(p.id(), l); |
| 274 } |
| 275 |
252 void ParamTraits<ExtensionMsg_PermissionSetStruct>::Write(Message* m, | 276 void ParamTraits<ExtensionMsg_PermissionSetStruct>::Write(Message* m, |
253 const param_type& p) { | 277 const param_type& p) { |
254 WriteParam(m, p.apis); | 278 WriteParam(m, p.apis); |
255 WriteParam(m, p.manifest_permissions); | 279 WriteParam(m, p.manifest_permissions); |
256 WriteParam(m, p.explicit_hosts); | 280 WriteParam(m, p.explicit_hosts); |
257 WriteParam(m, p.scriptable_hosts); | 281 WriteParam(m, p.scriptable_hosts); |
258 } | 282 } |
259 | 283 |
260 bool ParamTraits<ExtensionMsg_PermissionSetStruct>::Read(const Message* m, | 284 bool ParamTraits<ExtensionMsg_PermissionSetStruct>::Read(const Message* m, |
261 PickleIterator* iter, | 285 PickleIterator* iter, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 ReadParam(m, iter, &p->active_permissions) && | 318 ReadParam(m, iter, &p->active_permissions) && |
295 ReadParam(m, iter, &p->withheld_permissions); | 319 ReadParam(m, iter, &p->withheld_permissions); |
296 } | 320 } |
297 | 321 |
298 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, | 322 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, |
299 std::string* l) { | 323 std::string* l) { |
300 l->append(p.id); | 324 l->append(p.id); |
301 } | 325 } |
302 | 326 |
303 } // namespace IPC | 327 } // namespace IPC |
OLD | NEW |