OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/common/pepper_file_messages.h" | |
6 | |
7 namespace IPC { | |
8 | |
9 void ParamTraits<webkit::ppapi::PepperFilePath>::Write(Message* m, | |
10 const param_type& p) { | |
11 WriteParam(m, static_cast<unsigned>(p.domain())); | |
12 WriteParam(m, p.path()); | |
13 } | |
14 | |
15 bool ParamTraits<webkit::ppapi::PepperFilePath>::Read(const Message* m, | |
16 PickleIterator* iter, | |
17 param_type* p) { | |
18 unsigned domain; | |
19 FilePath path; | |
20 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) | |
21 return false; | |
22 if (domain > webkit::ppapi::PepperFilePath::DOMAIN_MAX_VALID) | |
23 return false; | |
24 | |
25 *p = webkit::ppapi::PepperFilePath( | |
26 static_cast<webkit::ppapi::PepperFilePath::Domain>(domain), path); | |
27 return true; | |
28 } | |
29 | |
30 void ParamTraits<webkit::ppapi::PepperFilePath>::Log(const param_type& p, | |
31 std::string* l) { | |
32 l->append("("); | |
33 LogParam(static_cast<unsigned>(p.domain()), l); | |
34 l->append(", "); | |
35 LogParam(p.path(), l); | |
36 l->append(")"); | |
37 } | |
38 | |
39 } // namespace IPC | |
OLD | NEW |