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

Side by Side Diff: chrome/common/pepper_messages.cc

Issue 6388004: Move non-file-system Pepper IPC messages to chrome/common/pepper_messages.*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/renderer
Patch Set: Fix size_t-size-correctness. Created 9 years, 11 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 | « chrome/common/pepper_messages.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 "chrome/common/common_param_traits.h"
6 #include "ppapi/c/private/ppb_flash.h"
7
8 #define IPC_MESSAGE_IMPL
9 #include "chrome/common/pepper_messages.h"
10
11 namespace IPC {
12
13 void ParamTraits<PP_Flash_NetAddress>::Write(Message* m, const param_type& p) {
14 WriteParam(m, p.size);
15 m->WriteBytes(p.data, static_cast<int>(p.size));
16 }
17
18 bool ParamTraits<PP_Flash_NetAddress>::Read(const Message* m,
19 void** iter,
20 param_type* p) {
21 uint16 size;
22 if (!ReadParam(m, iter, &size))
23 return false;
24 if (size > sizeof(p->data))
25 return false;
26 p->size = size;
27
28 const char* data;
29 if (!m->ReadBytes(iter, &data, size))
30 return false;
31 memcpy(p->data, data, size);
32 return true;
33 }
34
35 void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p,
36 std::string* l) {
37 l->append("<PP_Flash_NetAddress (");
38 LogParam(p.size, l);
39 l->append(" bytes)>");
40 }
41
42 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/pepper_messages.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698