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

Side by Side Diff: content/common/pepper_file_messages.cc

Issue 10387195: Open pepper files directly in browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698