// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/common/common_param_traits.h" #include "ppapi/c/private/ppb_flash.h" #define IPC_MESSAGE_IMPL #include "chrome/common/pepper_messages.h" namespace IPC { void ParamTraits::Write(Message* m, const param_type& p) { WriteParam(m, p.size); m->WriteBytes(p.data, static_cast(p.size)); } bool ParamTraits::Read(const Message* m, void** iter, param_type* p) { uint16 size; if (!ReadParam(m, iter, &size)) return false; if (size > sizeof(p->data)) return false; p->size = size; const char* data; if (!m->ReadBytes(iter, &data, size)) return false; memcpy(p->data, data, size); return true; } void ParamTraits::Log(const param_type& p, std::string* l) { l->append("append(" bytes)>"); } } // namespace IPC