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

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

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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
« no previous file with comments | « content/common/pepper_file_messages.h ('k') | content/common/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "content/common/pepper_file_messages.h" 5 #include "content/common/pepper_file_messages.h"
6 6
7 namespace IPC { 7 namespace IPC {
8 8
9 void ParamTraits<webkit::ppapi::PepperFilePath>::Write(Message* m, 9 void ParamTraits<webkit::ppapi::PepperFilePath>::Write(Message* m,
10 const param_type& p) { 10 const param_type& p) {
11 WriteParam(m, static_cast<unsigned>(p.domain())); 11 WriteParam(m, static_cast<unsigned>(p.domain()));
12 WriteParam(m, p.path()); 12 WriteParam(m, p.path());
13 } 13 }
14 14
15 bool ParamTraits<webkit::ppapi::PepperFilePath>::Read(const Message* m, 15 bool ParamTraits<webkit::ppapi::PepperFilePath>::Read(const Message* m,
16 void** iter, 16 PickleIterator* iter,
17 param_type* p) { 17 param_type* p) {
18 unsigned domain; 18 unsigned domain;
19 FilePath path; 19 FilePath path;
20 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) 20 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path))
21 return false; 21 return false;
22 if (domain > webkit::ppapi::PepperFilePath::DOMAIN_MAX_VALID) 22 if (domain > webkit::ppapi::PepperFilePath::DOMAIN_MAX_VALID)
23 return false; 23 return false;
24 24
25 *p = webkit::ppapi::PepperFilePath( 25 *p = webkit::ppapi::PepperFilePath(
26 static_cast<webkit::ppapi::PepperFilePath::Domain>(domain), path); 26 static_cast<webkit::ppapi::PepperFilePath::Domain>(domain), path);
27 return true; 27 return true;
28 } 28 }
29 29
30 void ParamTraits<webkit::ppapi::PepperFilePath>::Log(const param_type& p, 30 void ParamTraits<webkit::ppapi::PepperFilePath>::Log(const param_type& p,
31 std::string* l) { 31 std::string* l) {
32 l->append("("); 32 l->append("(");
33 LogParam(static_cast<unsigned>(p.domain()), l); 33 LogParam(static_cast<unsigned>(p.domain()), l);
34 l->append(", "); 34 l->append(", ");
35 LogParam(p.path(), l); 35 LogParam(p.path(), l);
36 l->append(")"); 36 l->append(")");
37 } 37 }
38 38
39 } // namespace IPC 39 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/pepper_file_messages.h ('k') | content/common/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698