Remove ParamTraits::GetSize since it's not used anymore.
The buffer now grows after r490340. BUG=742369, 761117 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: If735bd46400b96aae9eff1a6cbd4748c73e6668b Reviewed-on: https://chromium-review.googlesource.com/648249 Commit-Queue: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: enne <enne@chromium.org> Cr-Commit-Position: refs/heads/master@{#499355}
This commit is contained in:

committed by
Commit Bot

parent
0c0a2d07aa
commit
f4cec5503d
android_webview/common
cc/ipc
chrome/common
OWNERScast_messages.cccast_messages.hcommon_message_generator.cccommon_param_traits.cc
importer
safe_browsing
components
autofill
content
cdm
common
guest_view
nacl
network_hints
printing
common
safe_browsing
spellcheck
tracing
common
content
common
content_message_generator.cccontent_param_traits.cccontent_param_traits.h
input
media
resource_messages.ccresource_messages.hpublic
extensions/common
gpu/ipc/common
ipc
README.mdipc_message_macros.hipc_message_protobuf_utils.hipc_message_protobuf_utils_unittest.ccipc_message_utils.ccipc_message_utils.hipc_message_utils_unittest.ccipc_mojo_param_traits.ccipc_mojo_param_traits.hmach_port_mac.ccmach_port_mac.hparam_traits_macros.hparam_traits_size_macros.h
media
base
capture
gpu
mojo/public/cpp/bindings
lib
tests
ppapi/proxy
remoting/host
ui
gfx
ipc
latency
url/ipc
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "android_webview/common/android_webview_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "android_webview/common/android_webview_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -32,49 +32,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<cc::FilterOperation>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.type());
|
||||
switch (p.type()) {
|
||||
case cc::FilterOperation::GRAYSCALE:
|
||||
case cc::FilterOperation::SEPIA:
|
||||
case cc::FilterOperation::SATURATE:
|
||||
case cc::FilterOperation::HUE_ROTATE:
|
||||
case cc::FilterOperation::INVERT:
|
||||
case cc::FilterOperation::BRIGHTNESS:
|
||||
case cc::FilterOperation::SATURATING_BRIGHTNESS:
|
||||
case cc::FilterOperation::CONTRAST:
|
||||
case cc::FilterOperation::OPACITY:
|
||||
GetParamSize(s, p.amount());
|
||||
break;
|
||||
case cc::FilterOperation::BLUR:
|
||||
GetParamSize(s, p.amount());
|
||||
GetParamSize(s, p.blur_tile_mode());
|
||||
break;
|
||||
case cc::FilterOperation::DROP_SHADOW:
|
||||
GetParamSize(s, p.drop_shadow_offset());
|
||||
GetParamSize(s, p.amount());
|
||||
GetParamSize(s, p.drop_shadow_color());
|
||||
break;
|
||||
case cc::FilterOperation::COLOR_MATRIX:
|
||||
for (int i = 0; i < 20; ++i)
|
||||
GetParamSize(s, p.matrix()[i]);
|
||||
break;
|
||||
case cc::FilterOperation::ZOOM:
|
||||
GetParamSize(s, p.amount());
|
||||
GetParamSize(s, p.zoom_inset());
|
||||
break;
|
||||
case cc::FilterOperation::REFERENCE:
|
||||
GetParamSize(s, p.image_filter());
|
||||
break;
|
||||
case cc::FilterOperation::ALPHA_THRESHOLD:
|
||||
GetParamSize(s, p.amount());
|
||||
GetParamSize(s, p.outer_threshold());
|
||||
GetParamSize(s, p.shape());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<cc::FilterOperation>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
|
||||
@ -272,14 +229,6 @@ void ParamTraits<cc::FilterOperation>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<cc::FilterOperations>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, base::checked_cast<uint32_t>(p.size()));
|
||||
for (std::size_t i = 0; i < p.size(); ++i) {
|
||||
GetParamSize(s, p.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<cc::FilterOperations>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
|
||||
@ -319,17 +268,6 @@ void ParamTraits<cc::FilterOperations>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<sk_sp<SkImageFilter>>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
SkImageFilter* filter = p.get();
|
||||
if (filter) {
|
||||
sk_sp<SkData> data(SkValidatingSerializeFlattenable(filter));
|
||||
s->AddData(base::checked_cast<int>(data->size()));
|
||||
} else {
|
||||
s->AddData(0);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<sk_sp<SkImageFilter>>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
|
||||
@ -461,10 +399,10 @@ static size_t ReserveSizeForRenderPassWrite(const cc::RenderPass& p) {
|
||||
// The largest quad type, verified by a unit test.
|
||||
to_reserve += p.quad_list.size() * cc::LargestDrawQuadSize();
|
||||
|
||||
base::PickleSizer sizer;
|
||||
GetParamSize(&sizer, p.filters);
|
||||
GetParamSize(&sizer, p.background_filters);
|
||||
to_reserve += sizer.payload_size();
|
||||
to_reserve +=
|
||||
sizeof(uint32_t) + p.filters.size() * sizeof(cc::FilterOperation);
|
||||
to_reserve += sizeof(uint32_t) +
|
||||
p.background_filters.size() * sizeof(cc::FilterOperation);
|
||||
|
||||
return to_reserve;
|
||||
}
|
||||
@ -671,12 +609,6 @@ void ParamTraits<cc::RenderPass>::Log(const param_type& p, std::string* l) {
|
||||
l->append("])");
|
||||
}
|
||||
|
||||
void ParamTraits<viz::FrameSinkId>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.client_id());
|
||||
GetParamSize(s, p.sink_id());
|
||||
}
|
||||
|
||||
void ParamTraits<viz::FrameSinkId>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.client_id());
|
||||
@ -706,12 +638,6 @@ void ParamTraits<viz::FrameSinkId>::Log(const param_type& p, std::string* l) {
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<viz::LocalSurfaceId>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.local_id());
|
||||
GetParamSize(s, p.nonce());
|
||||
}
|
||||
|
||||
void ParamTraits<viz::LocalSurfaceId>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.local_id());
|
||||
@ -742,12 +668,6 @@ void ParamTraits<viz::LocalSurfaceId>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<viz::SurfaceId>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.frame_sink_id());
|
||||
GetParamSize(s, p.local_surface_id());
|
||||
}
|
||||
|
||||
void ParamTraits<viz::SurfaceId>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.frame_sink_id());
|
||||
WriteParam(m, p.local_surface_id());
|
||||
@ -776,13 +696,6 @@ void ParamTraits<viz::SurfaceId>::Log(const param_type& p, std::string* l) {
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<viz::SurfaceInfo>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.id());
|
||||
GetParamSize(s, p.device_scale_factor());
|
||||
GetParamSize(s, p.size_in_pixels());
|
||||
}
|
||||
|
||||
void ParamTraits<viz::SurfaceInfo>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.id());
|
||||
@ -906,13 +819,6 @@ void ParamTraits<cc::CompositorFrame>::Log(const param_type& p,
|
||||
l->append("])");
|
||||
}
|
||||
|
||||
void ParamTraits<cc::DrawQuad::Resources>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.count);
|
||||
for (size_t i = 0; i < p.count; ++i)
|
||||
GetParamSize(s, p.ids[i]);
|
||||
}
|
||||
|
||||
void ParamTraits<cc::DrawQuad::Resources>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
|
||||
@ -957,20 +863,6 @@ void ParamTraits<cc::DrawQuad::Resources>::Log(const param_type& p,
|
||||
l->append("])");
|
||||
}
|
||||
|
||||
void ParamTraits<cc::YUVVideoDrawQuad>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
ParamTraits<cc::DrawQuad>::GetSize(s, p);
|
||||
GetParamSize(s, p.ya_tex_coord_rect);
|
||||
GetParamSize(s, p.uv_tex_coord_rect);
|
||||
GetParamSize(s, p.ya_tex_size);
|
||||
GetParamSize(s, p.uv_tex_size);
|
||||
GetParamSize(s, p.color_space);
|
||||
GetParamSize(s, p.video_color_space);
|
||||
GetParamSize(s, p.resource_offset);
|
||||
GetParamSize(s, p.resource_multiplier);
|
||||
GetParamSize(s, p.bits_per_channel);
|
||||
}
|
||||
|
||||
void ParamTraits<cc::YUVVideoDrawQuad>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
ParamTraits<cc::DrawQuad>::Write(m, p);
|
||||
@ -1027,12 +919,6 @@ void ParamTraits<cc::YUVVideoDrawQuad>::Log(const param_type& p,
|
||||
l->append("])");
|
||||
}
|
||||
|
||||
void ParamTraits<viz::BeginFrameAck>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.sequence_number);
|
||||
GetParamSize(s, p.source_id);
|
||||
}
|
||||
|
||||
void ParamTraits<viz::BeginFrameAck>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
m->WriteUInt64(p.sequence_number);
|
||||
@ -1058,13 +944,6 @@ void ParamTraits<viz::BeginFrameAck>::Log(const param_type& p, std::string* l) {
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
|
||||
#include "cc/ipc/cc_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -26,7 +26,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<cc::FilterOperation> {
|
||||
typedef cc::FilterOperation param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -37,7 +36,6 @@ struct ParamTraits<cc::FilterOperation> {
|
||||
template <>
|
||||
struct ParamTraits<cc::FilterOperations> {
|
||||
typedef cc::FilterOperations param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -48,7 +46,6 @@ struct ParamTraits<cc::FilterOperations> {
|
||||
template <>
|
||||
struct ParamTraits<sk_sp<SkImageFilter>> {
|
||||
typedef sk_sp<SkImageFilter> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -69,7 +66,6 @@ struct CC_IPC_EXPORT ParamTraits<cc::RenderPass> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<viz::FrameSinkId> {
|
||||
typedef viz::FrameSinkId param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -80,7 +76,6 @@ struct CC_IPC_EXPORT ParamTraits<viz::FrameSinkId> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<viz::LocalSurfaceId> {
|
||||
typedef viz::LocalSurfaceId param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -91,7 +86,6 @@ struct CC_IPC_EXPORT ParamTraits<viz::LocalSurfaceId> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<viz::SurfaceId> {
|
||||
typedef viz::SurfaceId param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -102,7 +96,6 @@ struct CC_IPC_EXPORT ParamTraits<viz::SurfaceId> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<viz::SurfaceInfo> {
|
||||
typedef viz::SurfaceInfo param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -123,7 +116,6 @@ struct CC_IPC_EXPORT ParamTraits<cc::CompositorFrame> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<cc::DrawQuad::Resources> {
|
||||
typedef cc::DrawQuad::Resources param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -134,7 +126,6 @@ struct CC_IPC_EXPORT ParamTraits<cc::DrawQuad::Resources> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<cc::YUVVideoDrawQuad> {
|
||||
typedef cc::YUVVideoDrawQuad param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -145,7 +136,6 @@ struct CC_IPC_EXPORT ParamTraits<cc::YUVVideoDrawQuad> {
|
||||
template <>
|
||||
struct CC_IPC_EXPORT ParamTraits<viz::BeginFrameAck> {
|
||||
typedef viz::BeginFrameAck param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -17,6 +17,9 @@ per-file nacl_loader.sb=rsesek@chromium.org
|
||||
|
||||
per-file *_messages*.h=set noparent
|
||||
per-file *_messages*.h=file://ipc/SECURITY_OWNERS
|
||||
|
||||
per-file *_messages.cc=set noparent
|
||||
per-file *_messages.cc=file://ipc/SECURITY_OWNERS
|
||||
|
||||
per-file *_param_traits*.*=set noparent
|
||||
per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
|
||||
|
@ -6,11 +6,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<media::cast::RtpTimeTicks>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
ParamTraits<uint64_t>::GetSize(s, p.SerializeForIPC());
|
||||
}
|
||||
|
||||
void ParamTraits<media::cast::RtpTimeTicks>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
ParamTraits<uint64_t>::Write(m, p.SerializeForIPC());
|
||||
@ -34,11 +29,6 @@ void ParamTraits<media::cast::RtpTimeTicks>::Log(const param_type& p,
|
||||
l->append(oss.str());
|
||||
}
|
||||
|
||||
void ParamTraits<media::cast::FrameId>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
ParamTraits<uint64_t>::GetSize(s, p.SerializeForIPC());
|
||||
}
|
||||
|
||||
void ParamTraits<media::cast::FrameId>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
ParamTraits<uint64_t>::Write(m, p.SerializeForIPC());
|
||||
|
@ -21,7 +21,6 @@ namespace IPC {
|
||||
template<>
|
||||
struct ParamTraits<media::cast::RtpTimeTicks> {
|
||||
using param_type = media::cast::RtpTimeTicks;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -32,7 +31,6 @@ struct ParamTraits<media::cast::RtpTimeTicks> {
|
||||
template<>
|
||||
struct ParamTraits<media::cast::FrameId> {
|
||||
using param_type = media::cast::FrameId;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -16,13 +16,6 @@
|
||||
#include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h"
|
||||
#include "chrome/common/common_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
#include "chrome/common/safe_browsing/protobuf_message_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "chrome/common/common_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
#include "chrome/common/safe_browsing/protobuf_message_write_macros.h"
|
||||
|
@ -5,13 +5,6 @@
|
||||
// Get basic type definitions.
|
||||
#include "chrome/common/common_param_traits.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef CHROME_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
|
||||
#include "chrome/common/common_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -16,13 +16,6 @@
|
||||
#undef CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_PARAM_TRAITS_MACROS_H_
|
||||
#include "chrome/common/importer/profile_import_process_param_traits_macros.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_PARAM_TRAITS_MACROS_H_
|
||||
#include "chrome/common/importer/profile_import_process_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -39,7 +39,6 @@ source_set("safe_browsing") {
|
||||
"pe_image_reader_win.h",
|
||||
"protobuf_message_log_macros.h",
|
||||
"protobuf_message_read_macros.h",
|
||||
"protobuf_message_size_macros.h",
|
||||
"protobuf_message_write_macros.h",
|
||||
"safe_archive_analyzer_param_traits.h",
|
||||
"zip_analyzer.cc",
|
||||
|
@ -36,7 +36,6 @@
|
||||
template <> \
|
||||
struct IPC_MESSAGE_EXPORT ParamTraits<message_name> { \
|
||||
typedef message_name param_type; \
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p); \
|
||||
static void Write(base::Pickle* m, const param_type& p); \
|
||||
static bool Read(const base::Pickle* m, \
|
||||
base::PickleIterator* iter, \
|
||||
|
@ -9,11 +9,6 @@
|
||||
#define IPC_MESSAGE_IMPL
|
||||
#include "chrome/common/safe_browsing/ipc_protobuf_message_test_messages.h"
|
||||
|
||||
// Generate ipc protobuf traits size methods.
|
||||
#include "chrome/common/safe_browsing/protobuf_message_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "chrome/common/safe_browsing/ipc_protobuf_message_test_messages.h"
|
||||
} // namespace IPC
|
||||
// Generate ipc protobuf traits write methods.
|
||||
#include "chrome/common/safe_browsing/protobuf_message_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -1,31 +0,0 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
#ifndef CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_SIZE_MACROS_H_
|
||||
#define CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_SIZE_MACROS_H_
|
||||
|
||||
// Null out all the macros that need nulling.
|
||||
#include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h"
|
||||
|
||||
// Set up so next include will generate size methods.
|
||||
#undef IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN
|
||||
#undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER
|
||||
#undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER
|
||||
#undef IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER
|
||||
#undef IPC_PROTOBUF_MESSAGE_TRAITS_END
|
||||
|
||||
#define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \
|
||||
void ParamTraits<message_name>::GetSize(base::PickleSizer* s, \
|
||||
const param_type& p) {
|
||||
#define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER \
|
||||
IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER
|
||||
#define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name) \
|
||||
s->AddBool(); \
|
||||
if (p.has_##name()) \
|
||||
GetParamSize(s, p.name());
|
||||
#define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name) \
|
||||
GetParamSize(s, p.name());
|
||||
#define IPC_PROTOBUF_MESSAGE_TRAITS_END() }
|
||||
|
||||
#endif // CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_SIZE_MACROS_H_
|
@ -14,13 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/autofill/content/common/autofill_param_traits_macros.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_PARAM_TRAITS_MACROS_H_
|
||||
#include "components/autofill/content/common/autofill_param_traits_macros.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/cdm/common/cdm_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/cdm/common/cdm_message_generator.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/guest_view/common/guest_view_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/guest_view/common/guest_view_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -4,3 +4,5 @@ per-file *.mojom=set noparent
|
||||
per-file *.mojom=file://ipc/SECURITY_OWNERS
|
||||
per-file *_param_traits*.*=set noparent
|
||||
per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
|
||||
per-file *_messages.cc=set noparent
|
||||
per-file *_messages.cc=file://ipc/SECURITY_OWNERS
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/nacl/common/nacl_host_messages.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/nacl/common/nacl_host_messages.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/nacl/common/nacl_messages.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/nacl/common/nacl_messages.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -16,13 +16,6 @@
|
||||
#undef COMPONENTS_NACL_COMMON_NACL_TYPES_PARAM_TRAITS_H_
|
||||
#include "components/nacl/common/nacl_types_param_traits.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef COMPONENTS_NACL_COMMON_NACL_TYPES_PARAM_TRAITS_H_
|
||||
#include "components/nacl/common/nacl_types_param_traits.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/network_hints/common/network_hints_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/network_hints/common/network_hints_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -17,12 +17,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/printing/common/print_messages.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/printing/common/print_messages.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/safe_browsing/common/safebrowsing_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/safe_browsing/common/safebrowsing_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "components/spellcheck/common/spellcheck_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "components/spellcheck/common/spellcheck_message_generator.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -26,16 +26,6 @@
|
||||
#error "Failed to include components/tracing/common/tracing_messages.h"
|
||||
#endif
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef COMPONENTS_TRACING_COMMON_TRACING_MESSAGES_H_
|
||||
#include "components/tracing/common/tracing_messages.h"
|
||||
#ifndef COMPONENTS_TRACING_COMMON_TRACING_MESSAGES_H_
|
||||
#error "Failed to include components/tracing/common/tracing_messages.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "content/common/content_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "content/common/content_message_generator.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -16,11 +16,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<WebInputEventPointer>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
s->AddData(p->size());
|
||||
}
|
||||
|
||||
void ParamTraits<WebInputEventPointer>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
m->WriteData(reinterpret_cast<const char*>(p), p->size());
|
||||
@ -66,11 +61,6 @@ void ParamTraits<WebInputEventPointer>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<content::MessagePort>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
ParamTraits<mojo::MessagePipeHandle>::GetSize(s, p.GetHandle().get());
|
||||
}
|
||||
|
||||
void ParamTraits<content::MessagePort>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
ParamTraits<mojo::MessagePipeHandle>::Write(m, p.ReleaseHandle().release());
|
||||
@ -91,11 +81,6 @@ void ParamTraits<content::MessagePort>::Log(const param_type& p,
|
||||
std::string* l) {
|
||||
}
|
||||
|
||||
void ParamTraits<ui::AXMode>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
IPC::GetParamSize(s, p.mode());
|
||||
}
|
||||
|
||||
void ParamTraits<ui::AXMode>::Write(base::Pickle* m, const param_type& p) {
|
||||
IPC::WriteParam(m, p.mode());
|
||||
}
|
||||
@ -112,16 +97,6 @@ bool ParamTraits<ui::AXMode>::Read(const base::Pickle* m,
|
||||
|
||||
void ParamTraits<ui::AXMode>::Log(const param_type& p, std::string* l) {}
|
||||
|
||||
void ParamTraits<scoped_refptr<storage::BlobHandle>>::GetSize(
|
||||
base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
s->AddBool();
|
||||
if (p) {
|
||||
s->AddUInt32();
|
||||
s->AddAttachment();
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<storage::BlobHandle>>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -163,13 +138,6 @@ void ParamTraits<scoped_refptr<storage::BlobHandle>>::Log(const param_type& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
|
||||
#include "content/common/content_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -45,7 +45,6 @@ typedef const blink::WebInputEvent* WebInputEventPointer;
|
||||
template <>
|
||||
struct ParamTraits<WebInputEventPointer> {
|
||||
typedef WebInputEventPointer param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
// Note: upon read, the event has the lifetime of the message.
|
||||
static bool Read(const base::Pickle* m,
|
||||
@ -57,7 +56,6 @@ struct ParamTraits<WebInputEventPointer> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<content::MessagePort> {
|
||||
typedef content::MessagePort param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m, base::PickleIterator* iter,
|
||||
param_type* r);
|
||||
@ -67,7 +65,6 @@ struct CONTENT_EXPORT ParamTraits<content::MessagePort> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<ui::AXMode> {
|
||||
typedef ui::AXMode param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -78,7 +75,6 @@ struct CONTENT_EXPORT ParamTraits<ui::AXMode> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<scoped_refptr<storage::BlobHandle>> {
|
||||
typedef scoped_refptr<storage::BlobHandle> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -16,14 +16,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<ui::WebScopedInputEvent>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
bool valid_web_event = !!p;
|
||||
GetParamSize(s, valid_web_event);
|
||||
if (valid_web_event)
|
||||
GetParamSize(s, static_cast<WebInputEventPointer>(p.get()));
|
||||
}
|
||||
|
||||
void ParamTraits<ui::WebScopedInputEvent>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
bool valid_web_event = !!p;
|
||||
|
@ -17,7 +17,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<ui::WebScopedInputEvent> {
|
||||
typedef ui::WebScopedInputEvent param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -4,12 +4,6 @@
|
||||
|
||||
#include "content/common/media/media_devices_param_traits.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "content/common/media/media_devices_param_traits.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "content/common/media/media_stream_param_traits.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "content/common/media/media_stream_param_traits.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -9,16 +9,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.get() != NULL);
|
||||
if (p.get()) {
|
||||
base::Pickle temp;
|
||||
p->Persist(&temp, net::HttpResponseHeaders::PERSIST_SANS_COOKIES);
|
||||
s->AddBytes(temp.payload_size());
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -48,15 +38,6 @@ void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log(
|
||||
|
||||
namespace {
|
||||
|
||||
void GetCertSize(base::PickleSizer* s, net::X509Certificate* cert) {
|
||||
GetParamSize(s, !!cert);
|
||||
if (cert) {
|
||||
base::Pickle temp;
|
||||
cert->Persist(&temp);
|
||||
s->AddBytes(temp.payload_size());
|
||||
}
|
||||
}
|
||||
|
||||
void WriteCert(base::Pickle* m, net::X509Certificate* cert) {
|
||||
WriteParam(m, !!cert);
|
||||
if (cert)
|
||||
@ -79,33 +60,6 @@ bool ReadCert(const base::Pickle* m,
|
||||
|
||||
} // namespace
|
||||
|
||||
void ParamTraits<net::SSLInfo>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.is_valid());
|
||||
if (!p.is_valid())
|
||||
return;
|
||||
GetCertSize(s, p.cert.get());
|
||||
GetCertSize(s, p.unverified_cert.get());
|
||||
GetParamSize(s, p.cert_status);
|
||||
GetParamSize(s, p.security_bits);
|
||||
GetParamSize(s, p.key_exchange_group);
|
||||
GetParamSize(s, p.connection_status);
|
||||
GetParamSize(s, p.is_issued_by_known_root);
|
||||
GetParamSize(s, p.pkp_bypassed);
|
||||
GetParamSize(s, p.client_cert_sent);
|
||||
GetParamSize(s, p.channel_id_sent);
|
||||
GetParamSize(s, p.token_binding_negotiated);
|
||||
GetParamSize(s, p.token_binding_key_param);
|
||||
GetParamSize(s, p.handshake_type);
|
||||
GetParamSize(s, p.public_key_hashes);
|
||||
GetParamSize(s, p.pinning_failure_log);
|
||||
GetParamSize(s, p.signed_certificate_timestamps);
|
||||
GetParamSize(s, p.ct_compliance_details_available);
|
||||
GetParamSize(s, p.ct_cert_policy_compliance);
|
||||
GetParamSize(s, p.ocsp_result.response_status);
|
||||
GetParamSize(s, p.ocsp_result.revocation_status);
|
||||
}
|
||||
|
||||
void ParamTraits<net::SSLInfo>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.is_valid());
|
||||
if (!p.is_valid())
|
||||
@ -166,11 +120,6 @@ void ParamTraits<net::SSLInfo>::Log(const param_type& p, std::string* l) {
|
||||
l->append("<SSLInfo>");
|
||||
}
|
||||
|
||||
void ParamTraits<net::HashValue>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.ToString());
|
||||
}
|
||||
|
||||
void ParamTraits<net::HashValue>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.ToString());
|
||||
}
|
||||
@ -186,49 +135,6 @@ void ParamTraits<net::HashValue>::Log(const param_type& p, std::string* l) {
|
||||
l->append("<HashValue>");
|
||||
}
|
||||
|
||||
void ParamTraits<storage::DataElement>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, static_cast<int>(p.type()));
|
||||
switch (p.type()) {
|
||||
case storage::DataElement::TYPE_BYTES: {
|
||||
s->AddData(static_cast<int>(p.length()));
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_BYTES_DESCRIPTION: {
|
||||
GetParamSize(s, p.length());
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_FILE: {
|
||||
GetParamSize(s, p.path());
|
||||
GetParamSize(s, p.offset());
|
||||
GetParamSize(s, p.length());
|
||||
GetParamSize(s, p.expected_modification_time());
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_FILE_FILESYSTEM: {
|
||||
GetParamSize(s, p.filesystem_url());
|
||||
GetParamSize(s, p.offset());
|
||||
GetParamSize(s, p.length());
|
||||
GetParamSize(s, p.expected_modification_time());
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_BLOB: {
|
||||
GetParamSize(s, p.blob_uuid());
|
||||
GetParamSize(s, p.offset());
|
||||
GetParamSize(s, p.length());
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_DISK_CACHE_ENTRY: {
|
||||
NOTREACHED() << "Can't be sent by IPC.";
|
||||
break;
|
||||
}
|
||||
case storage::DataElement::TYPE_UNKNOWN: {
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<storage::DataElement>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.type()));
|
||||
@ -355,19 +261,6 @@ void ParamTraits<storage::DataElement>::Log(const param_type& p,
|
||||
l->append("<storage::DataElement>");
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.get() != NULL);
|
||||
if (p.get()) {
|
||||
GetParamSize(s, p->http_status_code);
|
||||
GetParamSize(s, p->http_status_text);
|
||||
GetParamSize(s, p->request_headers);
|
||||
GetParamSize(s, p->response_headers);
|
||||
GetParamSize(s, p->request_headers_text);
|
||||
GetParamSize(s, p->response_headers_text);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -412,30 +305,6 @@ void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> >::Log(
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<net::LoadTimingInfo>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.socket_log_id);
|
||||
GetParamSize(s, p.socket_reused);
|
||||
GetParamSize(s, p.request_start_time.is_null());
|
||||
if (p.request_start_time.is_null())
|
||||
return;
|
||||
GetParamSize(s, p.request_start_time);
|
||||
GetParamSize(s, p.request_start);
|
||||
GetParamSize(s, p.proxy_resolve_start);
|
||||
GetParamSize(s, p.proxy_resolve_end);
|
||||
GetParamSize(s, p.connect_timing.dns_start);
|
||||
GetParamSize(s, p.connect_timing.dns_end);
|
||||
GetParamSize(s, p.connect_timing.connect_start);
|
||||
GetParamSize(s, p.connect_timing.connect_end);
|
||||
GetParamSize(s, p.connect_timing.ssl_start);
|
||||
GetParamSize(s, p.connect_timing.ssl_end);
|
||||
GetParamSize(s, p.send_start);
|
||||
GetParamSize(s, p.send_end);
|
||||
GetParamSize(s, p.receive_headers_end);
|
||||
GetParamSize(s, p.push_start);
|
||||
GetParamSize(s, p.push_end);
|
||||
}
|
||||
|
||||
void ParamTraits<net::LoadTimingInfo>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.socket_log_id);
|
||||
@ -529,17 +398,6 @@ void ParamTraits<net::LoadTimingInfo>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<content::ResourceRequestBody>>::GetSize(
|
||||
base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.get() != NULL);
|
||||
if (p.get()) {
|
||||
GetParamSize(s, *p->elements());
|
||||
GetParamSize(s, p->identifier());
|
||||
GetParamSize(s, p->contains_sensitive_info());
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<content::ResourceRequestBody>>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -582,24 +440,6 @@ void ParamTraits<scoped_refptr<content::ResourceRequestBody>>::Log(
|
||||
l->append("<ResourceRequestBody>");
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<net::ct::SignedCertificateTimestamp>>::GetSize(
|
||||
base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.get() != NULL);
|
||||
if (p.get()) {
|
||||
GetParamSize(s, static_cast<unsigned int>(p->version));
|
||||
GetParamSize(s, p->log_id);
|
||||
GetParamSize(s, p->timestamp);
|
||||
GetParamSize(s, p->extensions);
|
||||
GetParamSize(s, static_cast<unsigned int>(p->signature.hash_algorithm));
|
||||
GetParamSize(s,
|
||||
static_cast<unsigned int>(p->signature.signature_algorithm));
|
||||
GetParamSize(s, p->signature.signature_data);
|
||||
GetParamSize(s, static_cast<unsigned int>(p->origin));
|
||||
GetParamSize(s, p->log_description);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<scoped_refptr<net::ct::SignedCertificateTimestamp>>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
|
@ -48,7 +48,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
|
||||
typedef scoped_refptr<net::HttpResponseHeaders> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -59,7 +58,6 @@ struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<net::SSLInfo> {
|
||||
typedef net::SSLInfo param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -70,7 +68,6 @@ struct CONTENT_EXPORT ParamTraits<net::SSLInfo> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<net::HashValue> {
|
||||
typedef net::HashValue param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -81,7 +78,6 @@ struct CONTENT_EXPORT ParamTraits<net::HashValue> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<storage::DataElement> {
|
||||
typedef storage::DataElement param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -92,7 +88,6 @@ struct CONTENT_EXPORT ParamTraits<storage::DataElement> {
|
||||
template <>
|
||||
struct ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> > {
|
||||
typedef scoped_refptr<content::ResourceDevToolsInfo> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -103,7 +98,6 @@ struct ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> > {
|
||||
template <>
|
||||
struct ParamTraits<net::LoadTimingInfo> {
|
||||
typedef net::LoadTimingInfo param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -114,7 +108,6 @@ struct ParamTraits<net::LoadTimingInfo> {
|
||||
template <>
|
||||
struct ParamTraits<scoped_refptr<content::ResourceRequestBody>> {
|
||||
typedef scoped_refptr<content::ResourceRequestBody> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -125,7 +118,6 @@ struct ParamTraits<scoped_refptr<content::ResourceRequestBody>> {
|
||||
template <>
|
||||
struct ParamTraits<scoped_refptr<net::ct::SignedCertificateTimestamp>> {
|
||||
typedef scoped_refptr<net::ct::SignedCertificateTimestamp> param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -18,15 +18,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<url::Origin>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.unique());
|
||||
GetParamSize(s, p.scheme());
|
||||
GetParamSize(s, p.host());
|
||||
GetParamSize(s, p.port());
|
||||
GetParamSize(s, p.suborigin());
|
||||
}
|
||||
|
||||
void ParamTraits<url::Origin>::Write(base::Pickle* m, const url::Origin& p) {
|
||||
WriteParam(m, p.unique());
|
||||
WriteParam(m, p.scheme());
|
||||
@ -67,12 +58,6 @@ void ParamTraits<url::Origin>::Log(const url::Origin& p, std::string* l) {
|
||||
l->append(p.Serialize());
|
||||
}
|
||||
|
||||
void ParamTraits<net::HostPortPair>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.host());
|
||||
GetParamSize(s, p.port());
|
||||
}
|
||||
|
||||
void ParamTraits<net::HostPortPair>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.host());
|
||||
@ -96,13 +81,6 @@ void ParamTraits<net::HostPortPair>::Log(const param_type& p, std::string* l) {
|
||||
l->append(p.ToString());
|
||||
}
|
||||
|
||||
void ParamTraits<net::HttpRequestHeaders>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, static_cast<int>(p.GetHeaderVector().size()));
|
||||
for (size_t i = 0; i < p.GetHeaderVector().size(); ++i)
|
||||
GetParamSize(s, p.GetHeaderVector()[i]);
|
||||
}
|
||||
|
||||
void ParamTraits<net::HttpRequestHeaders>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.GetHeaderVector().size()));
|
||||
@ -133,12 +111,6 @@ void ParamTraits<net::HttpRequestHeaders>::Log(const param_type& p,
|
||||
l->append(p.ToString());
|
||||
}
|
||||
|
||||
void ParamTraits<net::IPEndPoint>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.address());
|
||||
GetParamSize(s, p.port());
|
||||
}
|
||||
|
||||
void ParamTraits<net::IPEndPoint>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.address());
|
||||
WriteParam(m, p.port());
|
||||
@ -162,14 +134,6 @@ void ParamTraits<net::IPEndPoint>::Log(const param_type& p, std::string* l) {
|
||||
LogParam("IPEndPoint:" + p.ToString(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<net::IPAddress>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
base::StackVector<uint8_t, 16> bytes;
|
||||
for (uint8_t byte : p.bytes())
|
||||
bytes->push_back(byte);
|
||||
GetParamSize(s, bytes);
|
||||
}
|
||||
|
||||
void ParamTraits<net::IPAddress>::Write(base::Pickle* m, const param_type& p) {
|
||||
base::StackVector<uint8_t, 16> bytes;
|
||||
for (uint8_t byte : p.bytes())
|
||||
@ -195,11 +159,6 @@ void ParamTraits<net::IPAddress>::Log(const param_type& p, std::string* l) {
|
||||
LogParam("IPAddress:" + (p.empty() ? "(empty)" : p.ToString()), l);
|
||||
}
|
||||
|
||||
void ParamTraits<content::PageState>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.ToEncodedData());
|
||||
}
|
||||
|
||||
void ParamTraits<content::PageState>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.ToEncodedData());
|
||||
@ -224,13 +183,6 @@ void ParamTraits<content::PageState>::Log(
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
|
||||
#include "content/public/common/common_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -48,7 +48,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<url::Origin> {
|
||||
typedef url::Origin param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -59,7 +58,6 @@ struct CONTENT_EXPORT ParamTraits<url::Origin> {
|
||||
template<>
|
||||
struct CONTENT_EXPORT ParamTraits<net::HostPortPair> {
|
||||
typedef net::HostPortPair param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -70,7 +68,6 @@ struct CONTENT_EXPORT ParamTraits<net::HostPortPair> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<net::HttpRequestHeaders> {
|
||||
typedef net::HttpRequestHeaders param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -81,7 +78,6 @@ struct CONTENT_EXPORT ParamTraits<net::HttpRequestHeaders> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<net::IPEndPoint> {
|
||||
typedef net::IPEndPoint param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -92,7 +88,6 @@ struct CONTENT_EXPORT ParamTraits<net::IPEndPoint> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<net::IPAddress> {
|
||||
typedef net::IPAddress param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -103,7 +98,6 @@ struct CONTENT_EXPORT ParamTraits<net::IPAddress> {
|
||||
template <>
|
||||
struct CONTENT_EXPORT ParamTraits<content::PageState> {
|
||||
typedef content::PageState param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "extensions/common/extension_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "extensions/common/extension_message_generator.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -113,12 +113,6 @@ scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension(
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<URLPattern>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.valid_schemes());
|
||||
GetParamSize(s, p.GetAsString());
|
||||
}
|
||||
|
||||
void ParamTraits<URLPattern>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.valid_schemes());
|
||||
WriteParam(m, p.GetAsString());
|
||||
@ -151,11 +145,6 @@ void ParamTraits<URLPattern>::Log(const param_type& p, std::string* l) {
|
||||
LogParam(p.GetAsString(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<URLPatternSet>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.patterns());
|
||||
}
|
||||
|
||||
void ParamTraits<URLPatternSet>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.patterns());
|
||||
}
|
||||
@ -177,11 +166,6 @@ void ParamTraits<URLPatternSet>::Log(const param_type& p, std::string* l) {
|
||||
LogParam(p.patterns(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<APIPermission::ID>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, static_cast<int>(p));
|
||||
}
|
||||
|
||||
void ParamTraits<APIPermission::ID>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p));
|
||||
@ -203,17 +187,6 @@ void ParamTraits<APIPermission::ID>::Log(
|
||||
LogParam(static_cast<int>(p), l);
|
||||
}
|
||||
|
||||
void ParamTraits<APIPermissionSet>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
APIPermissionSet::const_iterator it = p.begin();
|
||||
const APIPermissionSet::const_iterator end = p.end();
|
||||
GetParamSize(s, static_cast<uint32_t>(p.size()));
|
||||
for (; it != end; ++it) {
|
||||
GetParamSize(s, it->id());
|
||||
it->GetSize(s);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<APIPermissionSet>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
APIPermissionSet::const_iterator it = p.begin();
|
||||
@ -252,17 +225,6 @@ void ParamTraits<APIPermissionSet>::Log(
|
||||
LogParam(p.map(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<ManifestPermissionSet>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
ManifestPermissionSet::const_iterator it = p.begin();
|
||||
const ManifestPermissionSet::const_iterator end = p.end();
|
||||
GetParamSize(s, static_cast<uint32_t>(p.size()));
|
||||
for (; it != end; ++it) {
|
||||
GetParamSize(s, it->name());
|
||||
it->GetSize(s);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<ManifestPermissionSet>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
ManifestPermissionSet::const_iterator it = p.begin();
|
||||
@ -300,11 +262,6 @@ void ParamTraits<ManifestPermissionSet>::Log(
|
||||
LogParam(p.map(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<HostID>::GetSize(base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.type());
|
||||
GetParamSize(s, p.id());
|
||||
}
|
||||
|
||||
void ParamTraits<HostID>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.type());
|
||||
WriteParam(m, p.id());
|
||||
@ -329,14 +286,6 @@ void ParamTraits<HostID>::Log(
|
||||
LogParam(p.id(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<ExtensionMsg_PermissionSetStruct>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.apis);
|
||||
GetParamSize(s, p.manifest_permissions);
|
||||
GetParamSize(s, p.explicit_hosts);
|
||||
GetParamSize(s, p.scriptable_hosts);
|
||||
}
|
||||
|
||||
void ParamTraits<ExtensionMsg_PermissionSetStruct>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.apis);
|
||||
|
@ -358,7 +358,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<URLPattern> {
|
||||
typedef URLPattern param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -369,7 +368,6 @@ struct ParamTraits<URLPattern> {
|
||||
template <>
|
||||
struct ParamTraits<extensions::URLPatternSet> {
|
||||
typedef extensions::URLPatternSet param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -380,7 +378,6 @@ struct ParamTraits<extensions::URLPatternSet> {
|
||||
template <>
|
||||
struct ParamTraits<extensions::APIPermission::ID> {
|
||||
typedef extensions::APIPermission::ID param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -391,7 +388,6 @@ struct ParamTraits<extensions::APIPermission::ID> {
|
||||
template <>
|
||||
struct ParamTraits<extensions::APIPermissionSet> {
|
||||
typedef extensions::APIPermissionSet param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -402,7 +398,6 @@ struct ParamTraits<extensions::APIPermissionSet> {
|
||||
template <>
|
||||
struct ParamTraits<extensions::ManifestPermissionSet> {
|
||||
typedef extensions::ManifestPermissionSet param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -413,7 +408,6 @@ struct ParamTraits<extensions::ManifestPermissionSet> {
|
||||
template <>
|
||||
struct ParamTraits<HostID> {
|
||||
typedef HostID param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -424,7 +418,6 @@ struct ParamTraits<HostID> {
|
||||
template <>
|
||||
struct ParamTraits<ExtensionMsg_PermissionSetStruct> {
|
||||
typedef ExtensionMsg_PermissionSetStruct param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -69,8 +69,6 @@ class SimpleAPIPermission : public APIPermission {
|
||||
return new SimpleAPIPermission(info());
|
||||
}
|
||||
|
||||
void GetSize(base::PickleSizer* s) const override {}
|
||||
|
||||
void Write(base::Pickle* m) const override {}
|
||||
|
||||
bool Read(const base::Pickle* m, base::PickleIterator* iter) override {
|
||||
|
@ -327,9 +327,6 @@ class APIPermission {
|
||||
virtual APIPermission* Intersect(const APIPermission* rhs) const = 0;
|
||||
|
||||
// IPC functions
|
||||
// Gets the size of the data to be written.
|
||||
virtual void GetSize(base::PickleSizer* s) const = 0;
|
||||
|
||||
// Writes this into the given IPC message |m|.
|
||||
virtual void Write(base::Pickle* m) const = 0;
|
||||
|
||||
|
@ -27,12 +27,6 @@ bool ManifestPermission::Equal(const ManifestPermission* rhs) const {
|
||||
return ToValue()->Equals(rhs->ToValue().get());
|
||||
}
|
||||
|
||||
void ManifestPermission::GetSize(base::PickleSizer* s) const {
|
||||
base::ListValue singleton;
|
||||
singleton.Append(ToValue());
|
||||
IPC::GetParamSize(s, singleton);
|
||||
}
|
||||
|
||||
void ManifestPermission::Write(base::Pickle* m) const {
|
||||
base::ListValue singleton;
|
||||
singleton.Append(ToValue());
|
||||
|
@ -64,9 +64,6 @@ class ManifestPermission {
|
||||
bool Equal(const ManifestPermission* rhs) const;
|
||||
|
||||
// IPC functions
|
||||
// Gets the size of the data to be written.
|
||||
void GetSize(base::PickleSizer* s) const;
|
||||
|
||||
// Writes this into the given IPC message |m|.
|
||||
void Write(base::Pickle* m) const;
|
||||
|
||||
|
@ -153,10 +153,6 @@ class SetDisjunctionPermission : public APIPermission {
|
||||
return std::unique_ptr<base::Value>(list);
|
||||
}
|
||||
|
||||
void GetSize(base::PickleSizer* s) const override {
|
||||
IPC::GetParamSize(s, data_set_);
|
||||
}
|
||||
|
||||
void Write(base::Pickle* m) const override { IPC::WriteParam(m, data_set_); }
|
||||
|
||||
bool Read(const base::Pickle* m, base::PickleIterator* iter) override {
|
||||
|
@ -87,8 +87,6 @@ APIPermission* SettingsOverrideAPIPermission::Intersect(
|
||||
return new SettingsOverrideAPIPermission(info(), setting_value_);
|
||||
}
|
||||
|
||||
void SettingsOverrideAPIPermission::GetSize(base::PickleSizer* s) const {}
|
||||
|
||||
void SettingsOverrideAPIPermission::Write(base::Pickle* m) const {}
|
||||
|
||||
bool SettingsOverrideAPIPermission::Read(const base::Pickle* m,
|
||||
|
@ -33,7 +33,6 @@ class SettingsOverrideAPIPermission : public APIPermission {
|
||||
APIPermission* Diff(const APIPermission* rhs) const override;
|
||||
APIPermission* Union(const APIPermission* rhs) const override;
|
||||
APIPermission* Intersect(const APIPermission* rhs) const override;
|
||||
void GetSize(base::PickleSizer* s) const override;
|
||||
void Write(base::Pickle* m) const override;
|
||||
bool Read(const base::Pickle* m, base::PickleIterator* iter) override;
|
||||
void Log(std::string* log) const override;
|
||||
|
@ -12,12 +12,6 @@
|
||||
#include "gpu/command_buffer/common/sync_token.h"
|
||||
#include "gpu/command_buffer/common/texture_in_use_response.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "gpu/ipc/common/gpu_command_buffer_traits_multi.h"
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
@ -38,15 +32,6 @@ namespace IPC {
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<gpu::SyncToken>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
DCHECK(!p.HasData() || p.verified_flush());
|
||||
GetParamSize(s, p.verified_flush());
|
||||
GetParamSize(s, p.namespace_id());
|
||||
GetParamSize(s, p.command_buffer_id());
|
||||
GetParamSize(s, p.release_count());
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::SyncToken>::Write(base::Pickle* m, const param_type& p) {
|
||||
DCHECK(!p.HasData() || p.verified_flush());
|
||||
|
||||
@ -88,12 +73,6 @@ void ParamTraits<gpu::SyncToken>::Log(const param_type& p, std::string* l) {
|
||||
p.command_buffer_id().GetUnsafeValue(), p.release_count());
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::TextureInUseResponse>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.texture);
|
||||
GetParamSize(s, p.in_use);
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::TextureInUseResponse>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.texture);
|
||||
@ -120,11 +99,6 @@ void ParamTraits<gpu::TextureInUseResponse>::Log(const param_type& p,
|
||||
*l += base::StringPrintf("[%u: %d]", p.texture, static_cast<int>(p.in_use));
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::Mailbox>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
s->AddBytes(sizeof(p.name));
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::Mailbox>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteBytes(p.name, sizeof(p.name));
|
||||
}
|
||||
@ -145,13 +119,6 @@ void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) {
|
||||
*l += base::StringPrintf("%02x", p.name[i]);
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::MailboxHolder>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.mailbox);
|
||||
GetParamSize(s, p.sync_token);
|
||||
GetParamSize(s, p.texture_target);
|
||||
}
|
||||
|
||||
void ParamTraits<gpu::MailboxHolder>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.mailbox);
|
||||
|
@ -23,7 +23,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct GPU_EXPORT ParamTraits<gpu::SyncToken> {
|
||||
using param_type = gpu::SyncToken;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -34,7 +33,6 @@ struct GPU_EXPORT ParamTraits<gpu::SyncToken> {
|
||||
template <>
|
||||
struct GPU_EXPORT ParamTraits<gpu::TextureInUseResponse> {
|
||||
using param_type = gpu::TextureInUseResponse;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -45,7 +43,6 @@ struct GPU_EXPORT ParamTraits<gpu::TextureInUseResponse> {
|
||||
template<>
|
||||
struct GPU_EXPORT ParamTraits<gpu::Mailbox> {
|
||||
using param_type = gpu::Mailbox;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -56,7 +53,6 @@ struct GPU_EXPORT ParamTraits<gpu::Mailbox> {
|
||||
template <>
|
||||
struct GPU_EXPORT ParamTraits<gpu::MailboxHolder> {
|
||||
using param_type = gpu::MailboxHolder;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -67,9 +63,6 @@ struct GPU_EXPORT ParamTraits<gpu::MailboxHolder> {
|
||||
template <typename TypeMarker, typename WrappedType, WrappedType kInvalidValue>
|
||||
struct ParamTraits<gpu::IdType<TypeMarker, WrappedType, kInvalidValue>> {
|
||||
using param_type = gpu::IdType<TypeMarker, WrappedType, kInvalidValue>;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, p.GetUnsafeValue());
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.GetUnsafeValue());
|
||||
}
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "gpu/ipc/common/gpu_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "gpu/ipc/common/gpu_message_generator.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -5,13 +5,6 @@
|
||||
// Get basic type definitions.
|
||||
#include "gpu/ipc/common/gpu_param_traits.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef GPU_IPC_COMMON_GPU_PARAM_TRAITS_MACROS_H_
|
||||
#include "gpu/ipc/common/gpu_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -548,20 +548,8 @@ the wire format used is defined entirely by `IPC::ParamTraits<T>` for whatever
|
||||
`foo::mojom::MyGiganticStructure` to `foo::MyGiganticStructure`, your typemap
|
||||
must point to some header which defines
|
||||
`IPC::ParamTraits<foo::MyGiganticStructure>`.
|
||||
|
||||
Note that if your `ParamTraits` are defined manually (*i.e.* not by invocation
|
||||
of `IPC_STRUCT_TRAITS*` macros) you must also ensure that they define the new
|
||||
`GetSize` method:
|
||||
|
||||
``` cpp
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
`base::PickleSizer` has an interface analogous to `base::Pickle`, except that it
|
||||
merely accumulates a byte count rather than accumulating serialized data.
|
||||
|
||||
There are several examples of this traits implementation in common IPC traits
|
||||
defined [here](https://code.google.com/p/chromium/codesearch#chromium/src/ipc/ipc_message_utils.h).
|
||||
|
||||
|
@ -45,11 +45,6 @@
|
||||
// // Generate destructors.
|
||||
// #include "ipc/struct_destructor_macros.h"
|
||||
// #include "path/to/YYY_message_generator.h"
|
||||
// // Generate param traits size methods.
|
||||
// #include "ipc/param_traits_size_macros.h"
|
||||
// namespace IPC {
|
||||
// #include "path/to/YYY_message_generator.h"
|
||||
// } // namespace IPC
|
||||
// // Generate param traits write methods.
|
||||
// #include "ipc/param_traits_write_macros.h"
|
||||
// namespace IPC {
|
||||
|
@ -23,11 +23,6 @@ namespace IPC {
|
||||
template <class RepeatedFieldLike, class StorageType>
|
||||
struct RepeatedFieldParamTraits {
|
||||
typedef RepeatedFieldLike param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, p.size());
|
||||
for (int i = 0; i < p.size(); i++)
|
||||
GetParamSize(sizer, p.Get(i));
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.size());
|
||||
for (int i = 0; i < p.size(); i++)
|
||||
|
@ -24,9 +24,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<ipc_message_utils_test::TestMessage1> {
|
||||
typedef ipc_message_utils_test::TestMessage1 param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, p.number());
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.number());
|
||||
}
|
||||
@ -44,11 +41,6 @@ struct ParamTraits<ipc_message_utils_test::TestMessage1> {
|
||||
template <>
|
||||
struct ParamTraits<ipc_message_utils_test::TestMessage2> {
|
||||
typedef ipc_message_utils_test::TestMessage2 param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, p.numbers());
|
||||
GetParamSize(sizer, p.strings());
|
||||
GetParamSize(sizer, p.messages());
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.numbers());
|
||||
WriteParam(m, p.strings());
|
||||
@ -99,11 +91,6 @@ TEST(IPCMessageRepeatedFieldUtilsTest, RepeatedFieldShouldBeSerialized) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, message);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, message);
|
||||
|
||||
ASSERT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
base::PickleIterator iter(pickle);
|
||||
ipc_message_utils_test::TestMessage2 output;
|
||||
ASSERT_TRUE(IPC::ReadParam(&pickle, &iter, &output));
|
||||
@ -124,11 +111,6 @@ TEST(IPCMessageRepeatedFieldUtilsTest,
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, message);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, message);
|
||||
|
||||
ASSERT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
base::PickleIterator iter(pickle);
|
||||
ipc_message_utils_test::TestMessage2 output;
|
||||
ASSERT_TRUE(IPC::ReadParam(&pickle, &iter, &output));
|
||||
@ -144,11 +126,6 @@ TEST(IPCMessageRepeatedFieldUtilsTest, EmptyRepeatedFieldShouldBeSerialized) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, message);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, message);
|
||||
|
||||
ASSERT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
base::PickleIterator iter(pickle);
|
||||
ipc_message_utils_test::TestMessage2 output;
|
||||
ASSERT_TRUE(IPC::ReadParam(&pickle, &iter, &output));
|
||||
|
@ -77,69 +77,6 @@ bool ReadValue(const base::Pickle* m,
|
||||
std::unique_ptr<base::Value>* value,
|
||||
int recursion);
|
||||
|
||||
void GetValueSize(base::PickleSizer* sizer,
|
||||
const base::Value* value,
|
||||
int recursion) {
|
||||
if (recursion > kMaxRecursionDepth) {
|
||||
LOG(ERROR) << "Max recursion depth hit in GetValueSize.";
|
||||
return;
|
||||
}
|
||||
|
||||
sizer->AddInt();
|
||||
switch (value->GetType()) {
|
||||
case base::Value::Type::NONE:
|
||||
break;
|
||||
case base::Value::Type::BOOLEAN:
|
||||
sizer->AddBool();
|
||||
break;
|
||||
case base::Value::Type::INTEGER:
|
||||
sizer->AddInt();
|
||||
break;
|
||||
case base::Value::Type::DOUBLE:
|
||||
sizer->AddDouble();
|
||||
break;
|
||||
case base::Value::Type::STRING: {
|
||||
const base::Value* result;
|
||||
value->GetAsString(&result);
|
||||
if (value->GetAsString(&result)) {
|
||||
DCHECK(result);
|
||||
GetParamSize(sizer, result->GetString());
|
||||
} else {
|
||||
std::string str;
|
||||
bool as_string_result = value->GetAsString(&str);
|
||||
DCHECK(as_string_result);
|
||||
GetParamSize(sizer, str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case base::Value::Type::BINARY: {
|
||||
sizer->AddData(static_cast<int>(value->GetBlob().size()));
|
||||
break;
|
||||
}
|
||||
case base::Value::Type::DICTIONARY: {
|
||||
sizer->AddInt();
|
||||
const base::DictionaryValue* dict =
|
||||
static_cast<const base::DictionaryValue*>(value);
|
||||
for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd();
|
||||
it.Advance()) {
|
||||
GetParamSize(sizer, it.key());
|
||||
GetValueSize(sizer, &it.value(), recursion + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case base::Value::Type::LIST: {
|
||||
sizer->AddInt();
|
||||
const base::ListValue* list = static_cast<const base::ListValue*>(value);
|
||||
for (const auto& entry : *list) {
|
||||
GetValueSize(sizer, &entry, recursion + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NOTREACHED() << "Invalid base::Value type.";
|
||||
}
|
||||
}
|
||||
|
||||
void WriteValue(base::Pickle* m, const base::Value* value, int recursion) {
|
||||
bool result;
|
||||
if (recursion > kMaxRecursionDepth) {
|
||||
@ -346,11 +283,6 @@ void ParamTraits<bool>::Log(const param_type& p, std::string* l) {
|
||||
l->append(p ? "true" : "false");
|
||||
}
|
||||
|
||||
void ParamTraits<signed char>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddBytes(sizeof(param_type));
|
||||
}
|
||||
|
||||
void ParamTraits<signed char>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteBytes(&p, sizeof(param_type));
|
||||
}
|
||||
@ -369,11 +301,6 @@ void ParamTraits<signed char>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::IntToString(p));
|
||||
}
|
||||
|
||||
void ParamTraits<unsigned char>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddBytes(sizeof(param_type));
|
||||
}
|
||||
|
||||
void ParamTraits<unsigned char>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteBytes(&p, sizeof(param_type));
|
||||
}
|
||||
@ -392,11 +319,6 @@ void ParamTraits<unsigned char>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::UintToString(p));
|
||||
}
|
||||
|
||||
void ParamTraits<unsigned short>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddBytes(sizeof(param_type));
|
||||
}
|
||||
|
||||
void ParamTraits<unsigned short>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteBytes(&p, sizeof(param_type));
|
||||
}
|
||||
@ -446,11 +368,6 @@ void ParamTraits<float>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::StringPrintf("%e", p));
|
||||
}
|
||||
|
||||
void ParamTraits<double>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddBytes(sizeof(param_type));
|
||||
}
|
||||
|
||||
void ParamTraits<double>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteBytes(reinterpret_cast<const char*>(&p), sizeof(param_type));
|
||||
}
|
||||
@ -480,11 +397,6 @@ void ParamTraits<base::string16>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::UTF16ToUTF8(p));
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<char>>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddData(static_cast<int>(p.size()));
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<char>>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
if (p.empty()) {
|
||||
@ -511,11 +423,6 @@ void ParamTraits<std::vector<char> >::Log(const param_type& p, std::string* l) {
|
||||
LogBytes(p, l);
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<unsigned char>>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddData(static_cast<int>(p.size()));
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<unsigned char>>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
if (p.empty()) {
|
||||
@ -544,13 +451,6 @@ void ParamTraits<std::vector<unsigned char> >::Log(const param_type& p,
|
||||
LogBytes(p, l);
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<bool>>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
for (size_t i = 0; i < p.size(); ++i)
|
||||
GetParamSize(sizer, static_cast<bool>(p[i]));
|
||||
}
|
||||
|
||||
void ParamTraits<std::vector<bool>>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
@ -586,11 +486,6 @@ void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) {
|
||||
}
|
||||
}
|
||||
|
||||
void ParamTraits<base::DictionaryValue>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetValueSize(sizer, &p, 0);
|
||||
}
|
||||
|
||||
void ParamTraits<base::DictionaryValue>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteValue(m, &p, 0);
|
||||
@ -615,13 +510,6 @@ void ParamTraits<base::DictionaryValue>::Log(const param_type& p,
|
||||
}
|
||||
|
||||
#if defined(OS_POSIX)
|
||||
void ParamTraits<base::FileDescriptor>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.fd >= 0);
|
||||
if (p.fd >= 0)
|
||||
sizer->AddAttachment();
|
||||
}
|
||||
|
||||
void ParamTraits<base::FileDescriptor>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
// This serialization must be kept in sync with
|
||||
@ -680,24 +568,6 @@ void ParamTraits<base::FileDescriptor>::Log(const param_type& p,
|
||||
}
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
void ParamTraits<base::SharedMemoryHandle>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.IsValid());
|
||||
if (!p.IsValid())
|
||||
return;
|
||||
|
||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
GetParamSize(sizer, p.GetMemoryObject());
|
||||
#elif defined(OS_WIN)
|
||||
GetParamSize(sizer, p.GetHandle());
|
||||
#else
|
||||
sizer->AddAttachment();
|
||||
#endif
|
||||
|
||||
GetParamSize(sizer, p.GetGUID());
|
||||
GetParamSize(sizer, static_cast<uint64_t>(p.GetSize()));
|
||||
}
|
||||
|
||||
void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
// This serialization must be kept in sync with
|
||||
@ -822,13 +692,6 @@ void ParamTraits<base::SharedMemoryHandle>::Log(const param_type& p,
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
void ParamTraits<PlatformFileForTransit>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.IsValid());
|
||||
if (p.IsValid())
|
||||
GetParamSize(s, p.GetHandle());
|
||||
}
|
||||
|
||||
void ParamTraits<PlatformFileForTransit>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
m->WriteBool(p.IsValid());
|
||||
@ -863,11 +726,6 @@ void ParamTraits<PlatformFileForTransit>::Log(const param_type& p,
|
||||
}
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
void ParamTraits<base::FilePath>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
p.GetSizeForPickle(sizer);
|
||||
}
|
||||
|
||||
void ParamTraits<base::FilePath>::Write(base::Pickle* m, const param_type& p) {
|
||||
p.WriteToPickle(m);
|
||||
}
|
||||
@ -882,11 +740,6 @@ void ParamTraits<base::FilePath>::Log(const param_type& p, std::string* l) {
|
||||
ParamTraits<base::FilePath::StringType>::Log(p.value(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<base::ListValue>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetValueSize(sizer, &p, 0);
|
||||
}
|
||||
|
||||
void ParamTraits<base::ListValue>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteValue(m, &p, 0);
|
||||
}
|
||||
@ -908,12 +761,6 @@ void ParamTraits<base::ListValue>::Log(const param_type& p, std::string* l) {
|
||||
l->append(json);
|
||||
}
|
||||
|
||||
void ParamTraits<base::NullableString16>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.string());
|
||||
GetParamSize(sizer, p.is_null());
|
||||
}
|
||||
|
||||
void ParamTraits<base::NullableString16>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.string());
|
||||
@ -942,15 +789,6 @@ void ParamTraits<base::NullableString16>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<base::File::Info>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.size);
|
||||
GetParamSize(sizer, p.is_directory);
|
||||
GetParamSize(sizer, p.last_modified.ToDoubleT());
|
||||
GetParamSize(sizer, p.last_accessed.ToDoubleT());
|
||||
GetParamSize(sizer, p.creation_time.ToDoubleT());
|
||||
}
|
||||
|
||||
void ParamTraits<base::File::Info>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.size);
|
||||
@ -991,11 +829,6 @@ void ParamTraits<base::File::Info>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<base::Time>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt64();
|
||||
}
|
||||
|
||||
void ParamTraits<base::Time>::Write(base::Pickle* m, const param_type& p) {
|
||||
ParamTraits<int64_t>::Write(m, p.ToInternalValue());
|
||||
}
|
||||
@ -1014,11 +847,6 @@ void ParamTraits<base::Time>::Log(const param_type& p, std::string* l) {
|
||||
ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<base::TimeDelta>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt64();
|
||||
}
|
||||
|
||||
void ParamTraits<base::TimeDelta>::Write(base::Pickle* m, const param_type& p) {
|
||||
ParamTraits<int64_t>::Write(m, p.ToInternalValue());
|
||||
}
|
||||
@ -1038,11 +866,6 @@ void ParamTraits<base::TimeDelta>::Log(const param_type& p, std::string* l) {
|
||||
ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
|
||||
}
|
||||
|
||||
void ParamTraits<base::TimeTicks>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt64();
|
||||
}
|
||||
|
||||
void ParamTraits<base::TimeTicks>::Write(base::Pickle* m, const param_type& p) {
|
||||
ParamTraits<int64_t>::Write(m, p.ToInternalValue());
|
||||
}
|
||||
@ -1067,11 +890,6 @@ void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) {
|
||||
static_assert(sizeof(base::UnguessableToken) == 2 * sizeof(uint64_t),
|
||||
"base::UnguessableToken should be of size 2 * sizeof(uint64_t).");
|
||||
|
||||
void ParamTraits<base::UnguessableToken>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddBytes(2 * sizeof(uint64_t));
|
||||
}
|
||||
|
||||
void ParamTraits<base::UnguessableToken>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
DCHECK(!p.is_empty());
|
||||
@ -1103,15 +921,6 @@ void ParamTraits<base::UnguessableToken>::Log(const param_type& p,
|
||||
l->append(p.ToString());
|
||||
}
|
||||
|
||||
void ParamTraits<IPC::ChannelHandle>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
#if defined(OS_NACL_SFI)
|
||||
GetParamSize(sizer, p.socket);
|
||||
#else
|
||||
GetParamSize(sizer, p.mojo_handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParamTraits<IPC::ChannelHandle>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
#if defined(OS_NACL_SFI)
|
||||
@ -1142,19 +951,6 @@ void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<LogData>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.channel);
|
||||
GetParamSize(sizer, p.routing_id);
|
||||
GetParamSize(sizer, p.type);
|
||||
GetParamSize(sizer, p.flags);
|
||||
GetParamSize(sizer, p.sent);
|
||||
GetParamSize(sizer, p.receive);
|
||||
GetParamSize(sizer, p.dispatch);
|
||||
GetParamSize(sizer, p.message_name);
|
||||
GetParamSize(sizer, p.params);
|
||||
}
|
||||
|
||||
void ParamTraits<LogData>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.channel);
|
||||
WriteParam(m, p.routing_id);
|
||||
@ -1232,11 +1028,6 @@ void ParamTraits<Message>::Log(const Message& p, std::string* l) {
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
void ParamTraits<HANDLE>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt();
|
||||
}
|
||||
|
||||
// Note that HWNDs/HANDLE/HCURSOR/HACCEL etc are always 32 bits, even on 64
|
||||
// bit systems. That's why we use the Windows macros to convert to 32 bits.
|
||||
void ParamTraits<HANDLE>::Write(base::Pickle* m, const param_type& p) {
|
||||
@ -1257,11 +1048,6 @@ void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::StringPrintf("0x%p", p));
|
||||
}
|
||||
|
||||
void ParamTraits<LOGFONT>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddData(sizeof(LOGFONT));
|
||||
}
|
||||
|
||||
void ParamTraits<LOGFONT>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT));
|
||||
}
|
||||
@ -1287,10 +1073,6 @@ void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::StringPrintf("<LOGFONT>"));
|
||||
}
|
||||
|
||||
void ParamTraits<MSG>::GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddData(sizeof(MSG));
|
||||
}
|
||||
|
||||
void ParamTraits<MSG>::Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(MSG));
|
||||
}
|
||||
|
@ -87,12 +87,6 @@ struct CheckedTuple {
|
||||
typedef std::tuple<Ts...> Tuple;
|
||||
};
|
||||
|
||||
template <class P>
|
||||
static inline void GetParamSize(base::PickleSizer* sizer, const P& p) {
|
||||
typedef typename SimilarTypeTraits<P>::Type Type;
|
||||
ParamTraits<Type>::GetSize(sizer, static_cast<const Type&>(p));
|
||||
}
|
||||
|
||||
// This function is checked by 'IPC checker' part of find-bad-constructs
|
||||
// Clang plugin to make it's not called on the following types:
|
||||
// 1. long / unsigned long (but not typedefs to)
|
||||
@ -125,9 +119,6 @@ static inline void LogParam(const P& p, std::string* l) {
|
||||
template <>
|
||||
struct ParamTraits<bool> {
|
||||
typedef bool param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddBool();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteBool(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -140,7 +131,6 @@ struct ParamTraits<bool> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<signed char> {
|
||||
typedef signed char param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -151,7 +141,6 @@ struct IPC_EXPORT ParamTraits<signed char> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<unsigned char> {
|
||||
typedef unsigned char param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -162,7 +151,6 @@ struct IPC_EXPORT ParamTraits<unsigned char> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<unsigned short> {
|
||||
typedef unsigned short param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -173,9 +161,6 @@ struct IPC_EXPORT ParamTraits<unsigned short> {
|
||||
template <>
|
||||
struct ParamTraits<int> {
|
||||
typedef int param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddInt();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteInt(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -188,9 +173,6 @@ struct ParamTraits<int> {
|
||||
template <>
|
||||
struct ParamTraits<unsigned int> {
|
||||
typedef unsigned int param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddInt();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteInt(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -216,9 +198,6 @@ struct ParamTraits<unsigned int> {
|
||||
template <>
|
||||
struct ParamTraits<long> {
|
||||
typedef long param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddLong();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteLong(p);
|
||||
}
|
||||
@ -233,9 +212,6 @@ struct ParamTraits<long> {
|
||||
template <>
|
||||
struct ParamTraits<unsigned long> {
|
||||
typedef unsigned long param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddLong();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteLong(p);
|
||||
}
|
||||
@ -251,9 +227,6 @@ struct ParamTraits<unsigned long> {
|
||||
template <>
|
||||
struct ParamTraits<long long> {
|
||||
typedef long long param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddInt64();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteInt64(static_cast<int64_t>(p));
|
||||
}
|
||||
@ -268,9 +241,6 @@ struct ParamTraits<long long> {
|
||||
template <>
|
||||
struct ParamTraits<unsigned long long> {
|
||||
typedef unsigned long long param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddInt64();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteInt64(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -286,9 +256,6 @@ struct ParamTraits<unsigned long long> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<float> {
|
||||
typedef float param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddFloat();
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteFloat(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -301,7 +268,6 @@ struct IPC_EXPORT ParamTraits<float> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<double> {
|
||||
typedef double param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -312,10 +278,6 @@ struct IPC_EXPORT ParamTraits<double> {
|
||||
template <class P, size_t Size>
|
||||
struct ParamTraits<P[Size]> {
|
||||
using param_type = P[Size];
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
for (const P& element : p)
|
||||
GetParamSize(sizer, element);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
for (const P& element : p)
|
||||
WriteParam(m, element);
|
||||
@ -345,9 +307,6 @@ struct ParamTraits<P[Size]> {
|
||||
template <>
|
||||
struct ParamTraits<std::string> {
|
||||
typedef std::string param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddString(p);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) { m->WriteString(p); }
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -360,9 +319,6 @@ struct ParamTraits<std::string> {
|
||||
template <>
|
||||
struct ParamTraits<base::string16> {
|
||||
typedef base::string16 param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
sizer->AddString16(p);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
m->WriteString16(p);
|
||||
}
|
||||
@ -377,7 +333,6 @@ struct ParamTraits<base::string16> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<std::vector<char> > {
|
||||
typedef std::vector<char> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle*,
|
||||
base::PickleIterator* iter,
|
||||
@ -388,7 +343,6 @@ struct IPC_EXPORT ParamTraits<std::vector<char> > {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<std::vector<unsigned char> > {
|
||||
typedef std::vector<unsigned char> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -399,7 +353,6 @@ struct IPC_EXPORT ParamTraits<std::vector<unsigned char> > {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<std::vector<bool> > {
|
||||
typedef std::vector<bool> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -410,11 +363,6 @@ struct IPC_EXPORT ParamTraits<std::vector<bool> > {
|
||||
template <class P>
|
||||
struct ParamTraits<std::vector<P>> {
|
||||
typedef std::vector<P> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
for (size_t i = 0; i < p.size(); i++)
|
||||
GetParamSize(sizer, p[i]);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
for (size_t i = 0; i < p.size(); i++)
|
||||
@ -449,12 +397,6 @@ struct ParamTraits<std::vector<P>> {
|
||||
template <class P>
|
||||
struct ParamTraits<std::set<P> > {
|
||||
typedef std::set<P> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
for (iter = p.begin(); iter != p.end(); ++iter)
|
||||
GetParamSize(sizer, *iter);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
@ -483,14 +425,6 @@ struct ParamTraits<std::set<P> > {
|
||||
template <class K, class V, class C, class A>
|
||||
struct ParamTraits<std::map<K, V, C, A> > {
|
||||
typedef std::map<K, V, C, A> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
for (iter = p.begin(); iter != p.end(); ++iter) {
|
||||
GetParamSize(sizer, iter->first);
|
||||
GetParamSize(sizer, iter->second);
|
||||
}
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
@ -523,10 +457,6 @@ struct ParamTraits<std::map<K, V, C, A> > {
|
||||
template <class A, class B>
|
||||
struct ParamTraits<std::pair<A, B> > {
|
||||
typedef std::pair<A, B> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, p.first);
|
||||
GetParamSize(sizer, p.second);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.first);
|
||||
WriteParam(m, p.second);
|
||||
@ -550,7 +480,6 @@ struct ParamTraits<std::pair<A, B> > {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::DictionaryValue> {
|
||||
typedef base::DictionaryValue param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -577,7 +506,6 @@ struct IPC_EXPORT ParamTraits<base::DictionaryValue> {
|
||||
template<>
|
||||
struct IPC_EXPORT ParamTraits<base::FileDescriptor> {
|
||||
typedef base::FileDescriptor param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -589,7 +517,6 @@ struct IPC_EXPORT ParamTraits<base::FileDescriptor> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> {
|
||||
typedef base::SharedMemoryHandle param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -601,7 +528,6 @@ struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<PlatformFileForTransit> {
|
||||
typedef PlatformFileForTransit param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -613,7 +539,6 @@ struct IPC_EXPORT ParamTraits<PlatformFileForTransit> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::FilePath> {
|
||||
typedef base::FilePath param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -624,7 +549,6 @@ struct IPC_EXPORT ParamTraits<base::FilePath> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::ListValue> {
|
||||
typedef base::ListValue param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -635,7 +559,6 @@ struct IPC_EXPORT ParamTraits<base::ListValue> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::NullableString16> {
|
||||
typedef base::NullableString16 param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -646,7 +569,6 @@ struct IPC_EXPORT ParamTraits<base::NullableString16> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::File::Info> {
|
||||
typedef base::File::Info param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -669,7 +591,6 @@ struct SimilarTypeTraits<HWND> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::Time> {
|
||||
typedef base::Time param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -680,7 +601,6 @@ struct IPC_EXPORT ParamTraits<base::Time> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::TimeDelta> {
|
||||
typedef base::TimeDelta param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -691,7 +611,6 @@ struct IPC_EXPORT ParamTraits<base::TimeDelta> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::TimeTicks> {
|
||||
typedef base::TimeTicks param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -702,7 +621,6 @@ struct IPC_EXPORT ParamTraits<base::TimeTicks> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<base::UnguessableToken> {
|
||||
typedef base::UnguessableToken param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -713,7 +631,6 @@ struct IPC_EXPORT ParamTraits<base::UnguessableToken> {
|
||||
template <>
|
||||
struct ParamTraits<std::tuple<>> {
|
||||
typedef std::tuple<> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {}
|
||||
static void Write(base::Pickle* m, const param_type& p) {}
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -728,11 +645,6 @@ template <typename T, int index, int count>
|
||||
struct TupleParamTraitsHelper {
|
||||
using Next = TupleParamTraitsHelper<T, index + 1, count>;
|
||||
|
||||
static void GetSize(base::PickleSizer* sizer, const T& p) {
|
||||
GetParamSize(sizer, std::get<index>(p));
|
||||
Next::GetSize(sizer, p);
|
||||
}
|
||||
|
||||
static void Write(base::Pickle* m, const T& p) {
|
||||
WriteParam(m, std::get<index>(p));
|
||||
Next::Write(m, p);
|
||||
@ -752,7 +664,6 @@ struct TupleParamTraitsHelper {
|
||||
|
||||
template <typename T, int index>
|
||||
struct TupleParamTraitsHelper<T, index, index> {
|
||||
static void GetSize(base::PickleSizer* sizer, const T& p) {}
|
||||
static void Write(base::Pickle* m, const T& p) {}
|
||||
static bool Read(const base::Pickle* m, base::PickleIterator* iter, T* r) {
|
||||
return true;
|
||||
@ -766,10 +677,6 @@ struct ParamTraits<std::tuple<Args...>> {
|
||||
using Helper =
|
||||
TupleParamTraitsHelper<param_type, 0, std::tuple_size<param_type>::value>;
|
||||
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
Helper::GetSize(sizer, p);
|
||||
}
|
||||
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
Helper::Write(m, p);
|
||||
}
|
||||
@ -786,11 +693,6 @@ struct ParamTraits<std::tuple<Args...>> {
|
||||
template <class P, size_t stack_capacity>
|
||||
struct ParamTraits<base::StackVector<P, stack_capacity> > {
|
||||
typedef base::StackVector<P, stack_capacity> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p->size()));
|
||||
for (size_t i = 0; i < p->size(); i++)
|
||||
GetParamSize(sizer, p[i]);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p->size()));
|
||||
for (size_t i = 0; i < p->size(); i++)
|
||||
@ -831,14 +733,6 @@ struct ParamTraits<base::small_map<NormalMap, kArraySize, EqualKey, MapInit>> {
|
||||
using param_type = base::small_map<NormalMap, kArraySize, EqualKey, MapInit>;
|
||||
using K = typename param_type::key_type;
|
||||
using V = typename param_type::data_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
for (iter = p.begin(); iter != p.end(); ++iter) {
|
||||
GetParamSize(sizer, iter->first);
|
||||
GetParamSize(sizer, iter->second);
|
||||
}
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
typename param_type::const_iterator iter;
|
||||
@ -871,14 +765,6 @@ struct ParamTraits<base::small_map<NormalMap, kArraySize, EqualKey, MapInit>> {
|
||||
template <class Key, class Mapped, class Compare>
|
||||
struct ParamTraits<base::flat_map<Key, Mapped, Compare>> {
|
||||
using param_type = base::flat_map<Key, Mapped, Compare>;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
DCHECK(base::IsValueInRangeForNumericType<int>(p.size()));
|
||||
GetParamSize(sizer, static_cast<int>(p.size()));
|
||||
for (const auto& iter : p) {
|
||||
GetParamSize(sizer, iter.first);
|
||||
GetParamSize(sizer, iter.second);
|
||||
}
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
DCHECK(base::IsValueInRangeForNumericType<int>(p.size()));
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
@ -917,12 +803,6 @@ struct ParamTraits<base::flat_map<Key, Mapped, Compare>> {
|
||||
template <class P>
|
||||
struct ParamTraits<std::unique_ptr<P>> {
|
||||
typedef std::unique_ptr<P> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
bool valid = !!p;
|
||||
GetParamSize(sizer, valid);
|
||||
if (valid)
|
||||
GetParamSize(sizer, *p);
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
bool valid = !!p;
|
||||
WriteParam(m, valid);
|
||||
@ -959,12 +839,6 @@ struct ParamTraits<std::unique_ptr<P>> {
|
||||
template <class P>
|
||||
struct ParamTraits<base::Optional<P>> {
|
||||
typedef base::Optional<P> param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p) {
|
||||
const bool is_set = static_cast<bool>(p);
|
||||
GetParamSize(sizer, is_set);
|
||||
if (is_set)
|
||||
GetParamSize(sizer, p.value());
|
||||
}
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
const bool is_set = static_cast<bool>(p);
|
||||
WriteParam(m, is_set);
|
||||
@ -1001,7 +875,6 @@ struct ParamTraits<base::Optional<P>> {
|
||||
template<>
|
||||
struct IPC_EXPORT ParamTraits<IPC::ChannelHandle> {
|
||||
typedef ChannelHandle param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -1012,7 +885,6 @@ struct IPC_EXPORT ParamTraits<IPC::ChannelHandle> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<LogData> {
|
||||
typedef LogData param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -1035,7 +907,6 @@ struct IPC_EXPORT ParamTraits<Message> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<HANDLE> {
|
||||
typedef HANDLE param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -1046,7 +917,6 @@ struct IPC_EXPORT ParamTraits<HANDLE> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<LOGFONT> {
|
||||
typedef LOGFONT param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -1057,7 +927,6 @@ struct IPC_EXPORT ParamTraits<LOGFONT> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<MSG> {
|
||||
typedef MSG param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -96,48 +96,6 @@ TEST(IPCMessageUtilsTest, StackVector) {
|
||||
EXPECT_EQ(stack_vector[i], output[i]);
|
||||
}
|
||||
|
||||
// Tests that PickleSizer and Pickle agree on the size of a complex base::Value.
|
||||
TEST(IPCMessageUtilsTest, ValueSize) {
|
||||
std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue);
|
||||
value->SetKey("foo", base::Value(42));
|
||||
value->SetKey("bar", base::Value(3.14));
|
||||
value->SetKey("baz", base::Value("hello"));
|
||||
value->SetWithoutPathExpansion("qux", std::make_unique<base::Value>());
|
||||
|
||||
std::unique_ptr<base::DictionaryValue> nested_dict(new base::DictionaryValue);
|
||||
nested_dict->SetKey("foobar", base::Value(5));
|
||||
value->SetWithoutPathExpansion("nested", std::move(nested_dict));
|
||||
|
||||
std::unique_ptr<base::ListValue> list_value(new base::ListValue);
|
||||
list_value->AppendString("im a string");
|
||||
list_value->AppendString("im another string");
|
||||
value->SetWithoutPathExpansion("awesome-list", std::move(list_value));
|
||||
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, *value);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, *value);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
}
|
||||
|
||||
TEST(IPCMessageUtilsTest, JsonValueSize) {
|
||||
const char kJson[] = "[ { \"foo\": \"bar\", \"baz\": 1234.0 } ]";
|
||||
std::unique_ptr<base::Value> json_value = base::JSONReader::Read(kJson);
|
||||
EXPECT_NE(nullptr, json_value);
|
||||
base::ListValue value;
|
||||
value.Append(std::move(json_value));
|
||||
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, value);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, value);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
}
|
||||
|
||||
TEST(IPCMessageUtilsTest, MojoChannelHandle) {
|
||||
mojo::MessagePipe message_pipe;
|
||||
IPC::ChannelHandle channel_handle(message_pipe.handle0.release());
|
||||
@ -145,10 +103,6 @@ TEST(IPCMessageUtilsTest, MojoChannelHandle) {
|
||||
IPC::Message message;
|
||||
IPC::WriteParam(&message, channel_handle);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, channel_handle);
|
||||
EXPECT_EQ(sizer.payload_size(), message.payload_size());
|
||||
|
||||
base::PickleIterator iter(message);
|
||||
IPC::ChannelHandle result_handle;
|
||||
EXPECT_TRUE(IPC::ReadParam(&message, &iter, &result_handle));
|
||||
@ -160,11 +114,6 @@ TEST(IPCMessageUtilsTest, OptionalUnset) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, opt);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, opt);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
std::string log;
|
||||
IPC::LogParam(opt, &log);
|
||||
EXPECT_EQ("(unset)", log);
|
||||
@ -180,11 +129,6 @@ TEST(IPCMessageUtilsTest, OptionalSet) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, opt);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, opt);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
std::string log;
|
||||
IPC::LogParam(opt, &log);
|
||||
EXPECT_EQ("10", log);
|
||||
@ -220,11 +164,6 @@ TEST(IPCMessageUtilsTest, UnguessableTokenTest) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, token);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, token);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
std::string log;
|
||||
IPC::LogParam(token, &log);
|
||||
EXPECT_EQ(token.ToString(), log);
|
||||
@ -243,11 +182,6 @@ TEST(IPCMessageUtilsTest, FlatMap) {
|
||||
base::Pickle pickle;
|
||||
IPC::WriteParam(&pickle, input);
|
||||
|
||||
base::PickleSizer sizer;
|
||||
IPC::GetParamSize(&sizer, input);
|
||||
|
||||
EXPECT_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
|
||||
base::PickleIterator iter(pickle);
|
||||
base::flat_map<std::string, int> output;
|
||||
EXPECT_TRUE(IPC::ReadParam(&pickle, &iter, &output));
|
||||
|
@ -10,13 +10,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<mojo::MessagePipeHandle>::GetSize(base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.is_valid());
|
||||
if (p.is_valid())
|
||||
sizer->AddAttachment();
|
||||
}
|
||||
|
||||
void ParamTraits<mojo::MessagePipeHandle>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.is_valid());
|
||||
@ -48,14 +41,6 @@ void ParamTraits<mojo::MessagePipeHandle>::Log(const param_type& p,
|
||||
l->append(")");
|
||||
}
|
||||
|
||||
void ParamTraits<mojo::DataPipeConsumerHandle>::GetSize(
|
||||
base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
GetParamSize(sizer, p.is_valid());
|
||||
if (p.is_valid())
|
||||
sizer->AddAttachment();
|
||||
}
|
||||
|
||||
void ParamTraits<mojo::DataPipeConsumerHandle>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.is_valid());
|
||||
|
@ -15,7 +15,6 @@
|
||||
namespace base {
|
||||
class Pickle;
|
||||
class PickleIterator;
|
||||
class PickleSizer;
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
@ -23,7 +22,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<mojo::MessagePipeHandle> {
|
||||
typedef mojo::MessagePipeHandle param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m, base::PickleIterator* iter,
|
||||
param_type* r);
|
||||
@ -33,7 +31,6 @@ struct IPC_EXPORT ParamTraits<mojo::MessagePipeHandle> {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<mojo::DataPipeConsumerHandle> {
|
||||
typedef mojo::DataPipeConsumerHandle param_type;
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -11,12 +11,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
// static
|
||||
void ParamTraits<MachPortMac>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
s->AddAttachment();
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<MachPortMac>::Write(base::Pickle* m, const param_type& p) {
|
||||
if (!m->WriteAttachment(
|
||||
|
@ -71,7 +71,6 @@ class IPC_EXPORT MachPortMac {
|
||||
template <>
|
||||
struct IPC_EXPORT ParamTraits<MachPortMac> {
|
||||
typedef MachPortMac param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -13,8 +13,6 @@
|
||||
template <> \
|
||||
struct IPC_MESSAGE_EXPORT ParamTraits<struct_name> { \
|
||||
typedef struct_name param_type; \
|
||||
static void GetSize(base::PickleSizer* sizer, \
|
||||
const param_type& p); \
|
||||
static void Write(base::Pickle* m, const param_type& p); \
|
||||
static bool Read(const base::Pickle* m, \
|
||||
base::PickleIterator* iter, \
|
||||
@ -55,8 +53,6 @@
|
||||
template <> \
|
||||
struct IPC_MESSAGE_EXPORT ParamTraits<enum_name> { \
|
||||
typedef enum_name param_type; \
|
||||
static void GetSize(base::PickleSizer* sizer, \
|
||||
const param_type& p); \
|
||||
static void Write(base::Pickle* m, const param_type& p); \
|
||||
static bool Read(const base::Pickle* m, \
|
||||
base::PickleIterator* iter, \
|
||||
|
@ -1,40 +0,0 @@
|
||||
// Copyright 2016 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.
|
||||
|
||||
#ifndef IPC_PARAM_TRAITS_SIZE_MACROS_H_
|
||||
#define IPC_PARAM_TRAITS_SIZE_MACROS_H_
|
||||
|
||||
// Null out all the macros that need nulling.
|
||||
#include "ipc/ipc_message_null_macros.h"
|
||||
|
||||
// STRUCT declarations cause corresponding STRUCT_TRAITS declarations to occur.
|
||||
#undef IPC_STRUCT_BEGIN_WITH_PARENT
|
||||
#undef IPC_STRUCT_MEMBER
|
||||
#undef IPC_STRUCT_END
|
||||
#define IPC_STRUCT_BEGIN_WITH_PARENT(struct_name, parent) \
|
||||
IPC_STRUCT_TRAITS_BEGIN(struct_name)
|
||||
#define IPC_STRUCT_MEMBER(type, name, ...) IPC_STRUCT_TRAITS_MEMBER(name)
|
||||
#define IPC_STRUCT_END() IPC_STRUCT_TRAITS_END()
|
||||
|
||||
// Set up so next include will generate size methods.
|
||||
#undef IPC_STRUCT_TRAITS_BEGIN
|
||||
#undef IPC_STRUCT_TRAITS_MEMBER
|
||||
#undef IPC_STRUCT_TRAITS_PARENT
|
||||
#undef IPC_STRUCT_TRAITS_END
|
||||
#define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
|
||||
void ParamTraits<struct_name>::GetSize(base::PickleSizer* sizer, \
|
||||
const param_type& p) {
|
||||
#define IPC_STRUCT_TRAITS_MEMBER(name) GetParamSize(sizer, p.name);
|
||||
#define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::GetSize(sizer, p);
|
||||
#define IPC_STRUCT_TRAITS_END() }
|
||||
|
||||
#undef IPC_ENUM_TRAITS_VALIDATE
|
||||
#define IPC_ENUM_TRAITS_VALIDATE(enum_name, validation_expression) \
|
||||
void ParamTraits<enum_name>::GetSize(base::PickleSizer* sizer, \
|
||||
const param_type& value) { \
|
||||
sizer->AddInt(); \
|
||||
}
|
||||
|
||||
#endif // IPC_PARAM_TRAITS_SIZE_MACROS_H_
|
||||
|
@ -20,19 +20,6 @@ using media::ChannelLayout;
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<AudioParameters>::GetSize(base::PickleSizer* s,
|
||||
const AudioParameters& p) {
|
||||
GetParamSize(s, p.format());
|
||||
GetParamSize(s, p.channel_layout());
|
||||
GetParamSize(s, p.sample_rate());
|
||||
GetParamSize(s, p.bits_per_sample());
|
||||
GetParamSize(s, p.frames_per_buffer());
|
||||
GetParamSize(s, p.channels());
|
||||
GetParamSize(s, p.effects());
|
||||
GetParamSize(s, p.mic_positions());
|
||||
GetParamSize(s, p.latency_tag());
|
||||
}
|
||||
|
||||
void ParamTraits<AudioParameters>::Write(base::Pickle* m,
|
||||
const AudioParameters& p) {
|
||||
WriteParam(m, p.format());
|
||||
@ -84,7 +71,6 @@ void ParamTraits<AudioParameters>::Log(const AudioParameters& p,
|
||||
template <>
|
||||
struct ParamTraits<media::EncryptionScheme::Pattern> {
|
||||
typedef media::EncryptionScheme::Pattern param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -92,12 +78,6 @@ struct ParamTraits<media::EncryptionScheme::Pattern> {
|
||||
static void Log(const param_type& p, std::string* l);
|
||||
};
|
||||
|
||||
void ParamTraits<media::EncryptionScheme>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.mode());
|
||||
GetParamSize(s, p.pattern());
|
||||
}
|
||||
|
||||
void ParamTraits<media::EncryptionScheme>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.mode());
|
||||
@ -120,13 +100,6 @@ void ParamTraits<media::EncryptionScheme>::Log(const param_type& p,
|
||||
l->append(base::StringPrintf("<EncryptionScheme>"));
|
||||
}
|
||||
|
||||
void ParamTraits<media::EncryptionScheme::Pattern>::GetSize(
|
||||
base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.encrypt_blocks());
|
||||
GetParamSize(s, p.skip_blocks());
|
||||
}
|
||||
|
||||
void ParamTraits<media::EncryptionScheme::Pattern>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.encrypt_blocks());
|
||||
@ -151,13 +124,6 @@ void ParamTraits<media::EncryptionScheme::Pattern>::Log(const param_type& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef MEDIA_BASE_IPC_MEDIA_PARAM_TRAITS_MACROS_H_
|
||||
#include "media/base/ipc/media_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -19,7 +19,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<media::AudioParameters> {
|
||||
typedef media::AudioParameters param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -30,7 +29,6 @@ struct ParamTraits<media::AudioParameters> {
|
||||
template <>
|
||||
struct ParamTraits<media::EncryptionScheme> {
|
||||
typedef media::EncryptionScheme param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -17,14 +17,6 @@ using media::VideoCaptureFormat;
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<VideoCaptureFormat>::GetSize(base::PickleSizer* s,
|
||||
const VideoCaptureFormat& p) {
|
||||
GetParamSize(s, p.frame_size);
|
||||
GetParamSize(s, p.frame_rate);
|
||||
GetParamSize(s, p.pixel_format);
|
||||
GetParamSize(s, p.pixel_storage);
|
||||
}
|
||||
|
||||
void ParamTraits<VideoCaptureFormat>::Write(base::Pickle* m,
|
||||
const VideoCaptureFormat& p) {
|
||||
WriteParam(m, p.frame_size);
|
||||
@ -53,13 +45,6 @@ void ParamTraits<VideoCaptureFormat>::Log(const VideoCaptureFormat& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef MEDIA_CAPTURE_IPC_CAPTURE_PARAM_TRAITS_MACROS_H_
|
||||
#include "media/capture/ipc/capture_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -18,7 +18,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<media::VideoCaptureFormat> {
|
||||
typedef media::VideoCaptureFormat param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "media/gpu/ipc/common/media_message_generator.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "media/gpu/ipc/common/media_message_generator.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -12,20 +12,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<media::BitstreamBuffer>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.id());
|
||||
GetParamSize(s, static_cast<uint64_t>(p.size()));
|
||||
GetParamSize(s, static_cast<uint64_t>(p.offset()));
|
||||
GetParamSize(s, p.presentation_timestamp());
|
||||
GetParamSize(s, p.key_id());
|
||||
if (!p.key_id().empty()) {
|
||||
GetParamSize(s, p.iv());
|
||||
GetParamSize(s, p.subsamples());
|
||||
}
|
||||
GetParamSize(s, p.handle());
|
||||
}
|
||||
|
||||
void ParamTraits<media::BitstreamBuffer>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, p.id());
|
||||
@ -85,13 +71,6 @@ void ParamTraits<media::BitstreamBuffer>::Log(const param_type& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef MEDIA_GPU_IPC_COMMON_MEDIA_PARAM_TRAITS_MACROS_H_
|
||||
#include "media/gpu/ipc/common/media_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -13,7 +13,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<media::BitstreamBuffer> {
|
||||
using param_type = media::BitstreamBuffer;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -37,12 +37,6 @@ struct NativeStructSerializerImpl {
|
||||
base::Pickle pickle;
|
||||
Traits::Write(&pickle, value);
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
base::PickleSizer sizer;
|
||||
Traits::GetSize(&sizer, value);
|
||||
DCHECK_EQ(sizer.payload_size(), pickle.payload_size());
|
||||
#endif
|
||||
|
||||
// Allocate a uint8 array, initialize its header, and copy the Pickle in.
|
||||
writer->Allocate(pickle.payload_size(), buffer);
|
||||
memcpy(writer->array_writer()->storage(), pickle.payload(),
|
||||
|
@ -25,13 +25,6 @@ PickledStructBlink::~PickledStructBlink() {}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<mojo::test::PickledStructBlink>::GetSize(
|
||||
base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt();
|
||||
sizer->AddInt();
|
||||
}
|
||||
|
||||
void ParamTraits<mojo::test::PickledStructBlink>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
m->WriteInt(p.foo());
|
||||
@ -51,9 +44,6 @@ bool ParamTraits<mojo::test::PickledStructBlink>::Read(
|
||||
return true;
|
||||
}
|
||||
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
IPC_ENUM_TRAITS_MAX_VALUE(mojo::test::PickledEnumBlink,
|
||||
mojo::test::PickledEnumBlink::VALUE_1)
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
IPC_ENUM_TRAITS_MAX_VALUE(mojo::test::PickledEnumBlink,
|
||||
mojo::test::PickledEnumBlink::VALUE_1)
|
||||
|
@ -17,7 +17,6 @@
|
||||
namespace base {
|
||||
class Pickle;
|
||||
class PickleIterator;
|
||||
class PickleSizer;
|
||||
}
|
||||
|
||||
namespace mojo {
|
||||
@ -72,7 +71,6 @@ template <>
|
||||
struct ParamTraits<mojo::test::PickledStructBlink> {
|
||||
using param_type = mojo::test::PickledStructBlink;
|
||||
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -26,13 +26,6 @@ bool operator==(const PickledStructChromium& a,
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<mojo::test::PickledStructChromium>::GetSize(
|
||||
base::PickleSizer* sizer,
|
||||
const param_type& p) {
|
||||
sizer->AddInt();
|
||||
sizer->AddInt();
|
||||
}
|
||||
|
||||
void ParamTraits<mojo::test::PickledStructChromium>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -53,9 +46,6 @@ bool ParamTraits<mojo::test::PickledStructChromium>::Read(
|
||||
return true;
|
||||
}
|
||||
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
IPC_ENUM_TRAITS_MAX_VALUE(mojo::test::PickledEnumChromium,
|
||||
mojo::test::PickledEnumChromium::VALUE_2)
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
IPC_ENUM_TRAITS_MAX_VALUE(mojo::test::PickledEnumChromium,
|
||||
mojo::test::PickledEnumChromium::VALUE_2)
|
||||
|
@ -16,7 +16,6 @@
|
||||
namespace base {
|
||||
class Pickle;
|
||||
class PickleIterator;
|
||||
class PickleSizer;
|
||||
}
|
||||
|
||||
namespace mojo {
|
||||
@ -65,7 +64,6 @@ template <>
|
||||
struct ParamTraits<mojo::test::PickledStructChromium> {
|
||||
using param_type = mojo::test::PickledStructChromium;
|
||||
|
||||
static void GetSize(base::PickleSizer* sizer, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -26,16 +26,6 @@
|
||||
#error "Failed to include ppapi/proxy/ppapi_messages.h"
|
||||
#endif
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef PPAPI_PROXY_PPAPI_MESSAGES_H_
|
||||
#include "ppapi/proxy/ppapi_messages.h"
|
||||
#ifndef PPAPI_PROXY_PPAPI_MESSAGES_H_
|
||||
#error "Failed to include ppapi/proxy/ppapi_messages.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -78,11 +78,6 @@ void WriteVectorWithoutCopy(base::Pickle* m, const std::vector<T>& p) {
|
||||
|
||||
// PP_Bool ---------------------------------------------------------------------
|
||||
|
||||
// static
|
||||
void ParamTraits<PP_Bool>::GetSize(base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, PP_ToBool(p));
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<PP_Bool>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, PP_ToBool(p));
|
||||
@ -155,13 +150,6 @@ void ParamTraits<PP_KeyInformation>::Log(const param_type& p, std::string* l) {
|
||||
|
||||
// PP_NetAddress_Private -------------------------------------------------------
|
||||
|
||||
// static
|
||||
void ParamTraits<PP_NetAddress_Private>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.size);
|
||||
s->AddBytes(static_cast<int>(p.size));
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<PP_NetAddress_Private>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -197,13 +185,6 @@ void ParamTraits<PP_NetAddress_Private>::Log(const param_type& p,
|
||||
|
||||
// HostResource ----------------------------------------------------------------
|
||||
|
||||
// static
|
||||
void ParamTraits<ppapi::HostResource>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.instance());
|
||||
GetParamSize(s, p.host_resource());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<ppapi::HostResource>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
@ -272,12 +253,6 @@ void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Log(
|
||||
|
||||
// ppapi::PpapiPermissions -----------------------------------------------------
|
||||
|
||||
// static
|
||||
void ParamTraits<ppapi::PpapiPermissions>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.GetBits());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<ppapi::PpapiPermissions>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
|
@ -49,7 +49,6 @@ namespace IPC {
|
||||
template<>
|
||||
struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> {
|
||||
typedef PP_Bool param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -60,7 +59,6 @@ struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> {
|
||||
template <>
|
||||
struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> {
|
||||
typedef PP_NetAddress_Private param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -144,7 +142,6 @@ struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> {
|
||||
template<>
|
||||
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> {
|
||||
typedef ppapi::HostResource param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -176,7 +173,6 @@ struct PPAPI_PROXY_EXPORT ParamTraits<
|
||||
template<>
|
||||
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> {
|
||||
typedef ppapi::PpapiPermissions param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -1,5 +1,8 @@
|
||||
per-file *_messages*.h=set noparent
|
||||
per-file *_messages*.h=file://ipc/SECURITY_OWNERS
|
||||
|
||||
per-file *_messages.cc=set noparent
|
||||
per-file *_messages.cc=file://ipc/SECURITY_OWNERS
|
||||
|
||||
per-file *_param_traits*.*=set noparent
|
||||
per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
|
@ -14,12 +14,6 @@
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "remoting/host/chromoting_messages.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#include "remoting/host/chromoting_messages.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -13,13 +13,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopVector>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.x());
|
||||
GetParamSize(s, p.y());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopVector>::Write(base::Pickle* m,
|
||||
const webrtc::DesktopVector& p) {
|
||||
@ -45,13 +38,6 @@ void ParamTraits<webrtc::DesktopVector>::Log(const webrtc::DesktopVector& p,
|
||||
p.x(), p.y()));
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopSize>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.width());
|
||||
GetParamSize(s, p.height());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopSize>::Write(base::Pickle* m,
|
||||
const webrtc::DesktopSize& p) {
|
||||
@ -77,15 +63,6 @@ void ParamTraits<webrtc::DesktopSize>::Log(const webrtc::DesktopSize& p,
|
||||
p.width(), p.height()));
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopRect>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.left());
|
||||
GetParamSize(s, p.top());
|
||||
GetParamSize(s, p.right());
|
||||
GetParamSize(s, p.bottom());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<webrtc::DesktopRect>::Write(base::Pickle* m,
|
||||
const webrtc::DesktopRect& p) {
|
||||
@ -281,15 +258,6 @@ void ParamTraits<remoting::DesktopEnvironmentOptions>::Log(
|
||||
l->append("DesktopEnvironmentOptions()");
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<remoting::protocol::ProcessResourceUsage>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.process_name());
|
||||
GetParamSize(s, p.processor_usage());
|
||||
GetParamSize(s, p.working_set_size());
|
||||
GetParamSize(s, p.pagefile_size());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<remoting::protocol::ProcessResourceUsage>::Write(
|
||||
base::Pickle* m,
|
||||
@ -330,12 +298,6 @@ void ParamTraits<remoting::protocol::ProcessResourceUsage>::Log(
|
||||
l->append("ProcessResourceUsage(").append(p.process_name()).append(")");
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
GetParamSize(s, p.usages());
|
||||
}
|
||||
|
||||
// static
|
||||
void ParamTraits<remoting::protocol::AggregatedProcessResourceUsage>::Write(
|
||||
base::Pickle* m,
|
||||
|
@ -21,7 +21,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<webrtc::DesktopVector> {
|
||||
typedef webrtc::DesktopVector param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -32,7 +31,6 @@ struct ParamTraits<webrtc::DesktopVector> {
|
||||
template <>
|
||||
struct ParamTraits<webrtc::DesktopSize> {
|
||||
typedef webrtc::DesktopSize param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -43,7 +41,6 @@ struct ParamTraits<webrtc::DesktopSize> {
|
||||
template <>
|
||||
struct ParamTraits<webrtc::DesktopRect> {
|
||||
typedef webrtc::DesktopRect param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -84,7 +81,6 @@ struct ParamTraits<remoting::DesktopEnvironmentOptions> {
|
||||
template <>
|
||||
struct ParamTraits<remoting::protocol::ProcessResourceUsage> {
|
||||
typedef remoting::protocol::ProcessResourceUsage param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -95,7 +91,6 @@ struct ParamTraits<remoting::protocol::ProcessResourceUsage> {
|
||||
template <>
|
||||
struct ParamTraits<remoting::protocol::AggregatedProcessResourceUsage> {
|
||||
typedef remoting::protocol::AggregatedProcessResourceUsage param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -9,19 +9,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<gfx::ColorSpace>::GetSize(base::PickleSizer* s,
|
||||
const gfx::ColorSpace& p) {
|
||||
GetParamSize(s, p.primaries_);
|
||||
GetParamSize(s, p.transfer_);
|
||||
GetParamSize(s, p.matrix_);
|
||||
GetParamSize(s, p.range_);
|
||||
GetParamSize(s, p.icc_profile_id_);
|
||||
if (p.primaries_ == gfx::ColorSpace::PrimaryID::CUSTOM)
|
||||
s->AddBytes(sizeof(p.custom_primary_matrix_));
|
||||
if (p.transfer_ == gfx::ColorSpace::TransferID::CUSTOM)
|
||||
s->AddBytes(sizeof(p.custom_transfer_params_));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ColorSpace>::Write(base::Pickle* m,
|
||||
const gfx::ColorSpace& p) {
|
||||
WriteParam(m, p.primaries_);
|
||||
@ -73,12 +60,6 @@ void ParamTraits<gfx::ColorSpace>::Log(const gfx::ColorSpace& p,
|
||||
l->append("<gfx::ColorSpace>");
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ICCProfile>::GetSize(base::PickleSizer* s,
|
||||
const gfx::ICCProfile& p) {
|
||||
GetParamSize(s, p.id_);
|
||||
GetParamSize(s, p.data_);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ICCProfile>::Write(base::Pickle* m,
|
||||
const gfx::ICCProfile& p) {
|
||||
WriteParam(m, p.id_);
|
||||
@ -105,13 +86,6 @@ void ParamTraits<gfx::ICCProfile>::Log(const gfx::ICCProfile& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef UI_GFX_IPC_COLOR_GFX_PARAM_TRAITS_MACROS_H_
|
||||
#include "ui/gfx/ipc/color/gfx_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -21,7 +21,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct GFX_IPC_COLOR_EXPORT ParamTraits<gfx::ColorSpace> {
|
||||
typedef gfx::ColorSpace param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -32,7 +31,6 @@ struct GFX_IPC_COLOR_EXPORT ParamTraits<gfx::ColorSpace> {
|
||||
template <>
|
||||
struct GFX_IPC_COLOR_EXPORT ParamTraits<gfx::ICCProfile> {
|
||||
typedef gfx::ICCProfile param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -16,12 +16,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<gfx::Point>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Point& p) {
|
||||
GetParamSize(s, p.x());
|
||||
GetParamSize(s, p.y());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Point>::Write(base::Pickle* m, const gfx::Point& p) {
|
||||
WriteParam(m, p.x());
|
||||
WriteParam(m, p.y());
|
||||
@ -42,12 +36,6 @@ void ParamTraits<gfx::Point>::Log(const gfx::Point& p, std::string* l) {
|
||||
l->append(base::StringPrintf("(%d, %d)", p.x(), p.y()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::PointF>::GetSize(base::PickleSizer* s,
|
||||
const gfx::PointF& p) {
|
||||
GetParamSize(s, p.x());
|
||||
GetParamSize(s, p.y());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::PointF>::Write(base::Pickle* m, const gfx::PointF& p) {
|
||||
WriteParam(m, p.x());
|
||||
WriteParam(m, p.y());
|
||||
@ -68,13 +56,6 @@ void ParamTraits<gfx::PointF>::Log(const gfx::PointF& p, std::string* l) {
|
||||
l->append(base::StringPrintf("(%f, %f)", p.x(), p.y()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Point3F>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Point3F& p) {
|
||||
GetParamSize(s, p.x());
|
||||
GetParamSize(s, p.y());
|
||||
GetParamSize(s, p.z());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Point3F>::Write(base::Pickle* m, const gfx::Point3F& p) {
|
||||
WriteParam(m, p.x());
|
||||
WriteParam(m, p.y());
|
||||
@ -98,11 +79,6 @@ void ParamTraits<gfx::Point3F>::Log(const gfx::Point3F& p, std::string* l) {
|
||||
l->append(base::StringPrintf("(%f, %f, %f)", p.x(), p.y(), p.z()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Size>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Size& p) {
|
||||
s->AddBytes(sizeof(int) * 2);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Size>::Write(base::Pickle* m, const gfx::Size& p) {
|
||||
DCHECK_GE(p.width(), 0);
|
||||
DCHECK_GE(p.height(), 0);
|
||||
@ -128,11 +104,6 @@ void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::string* l) {
|
||||
l->append(base::StringPrintf("(%d, %d)", p.width(), p.height()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::SizeF>::GetSize(base::PickleSizer* s,
|
||||
const gfx::SizeF& p) {
|
||||
s->AddBytes(sizeof(float) * 2);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::SizeF>::Write(base::Pickle* m, const gfx::SizeF& p) {
|
||||
float values[2] = {p.width(), p.height()};
|
||||
m->WriteBytes(&values, sizeof(float) * 2);
|
||||
@ -154,11 +125,6 @@ void ParamTraits<gfx::SizeF>::Log(const gfx::SizeF& p, std::string* l) {
|
||||
l->append(base::StringPrintf("(%f, %f)", p.width(), p.height()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Vector2d>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Vector2d& p) {
|
||||
s->AddBytes(sizeof(int) * 2);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Vector2d>::Write(base::Pickle* m,
|
||||
const gfx::Vector2d& p) {
|
||||
int values[2] = {p.x(), p.y()};
|
||||
@ -181,11 +147,6 @@ void ParamTraits<gfx::Vector2d>::Log(const gfx::Vector2d& v, std::string* l) {
|
||||
l->append(base::StringPrintf("(%d, %d)", v.x(), v.y()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Vector2dF>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Vector2dF& p) {
|
||||
s->AddBytes(sizeof(float) * 2);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Vector2dF>::Write(base::Pickle* m,
|
||||
const gfx::Vector2dF& p) {
|
||||
float values[2] = {p.x(), p.y()};
|
||||
@ -208,11 +169,6 @@ void ParamTraits<gfx::Vector2dF>::Log(const gfx::Vector2dF& v, std::string* l) {
|
||||
l->append(base::StringPrintf("(%f, %f)", v.x(), v.y()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Rect>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Rect& p) {
|
||||
s->AddBytes(sizeof(int) * 4);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Rect>::Write(base::Pickle* m, const gfx::Rect& p) {
|
||||
int values[4] = {p.x(), p.y(), p.width(), p.height()};
|
||||
m->WriteBytes(&values, sizeof(int) * 4);
|
||||
@ -236,11 +192,6 @@ void ParamTraits<gfx::Rect>::Log(const gfx::Rect& p, std::string* l) {
|
||||
p.height()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::RectF>::GetSize(base::PickleSizer* s,
|
||||
const gfx::RectF& p) {
|
||||
s->AddBytes(sizeof(float) * 4);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::RectF>::Write(base::Pickle* m, const gfx::RectF& p) {
|
||||
float values[4] = {p.x(), p.y(), p.width(), p.height()};
|
||||
m->WriteBytes(&values, sizeof(float) * 4);
|
||||
@ -262,12 +213,6 @@ void ParamTraits<gfx::RectF>::Log(const gfx::RectF& p, std::string* l) {
|
||||
p.height()));
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ScrollOffset>::GetSize(base::PickleSizer* s,
|
||||
const gfx::ScrollOffset& p) {
|
||||
GetParamSize(s, p.x());
|
||||
GetParamSize(s, p.y());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ScrollOffset>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
m->WriteDouble(p.x());
|
||||
|
@ -29,7 +29,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point> {
|
||||
typedef gfx::Point param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -40,7 +39,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::PointF> {
|
||||
typedef gfx::PointF param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -51,7 +49,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::PointF> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point3F> {
|
||||
typedef gfx::Point3F param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -62,7 +59,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point3F> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Size> {
|
||||
typedef gfx::Size param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -73,7 +69,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Size> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::SizeF> {
|
||||
typedef gfx::SizeF param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -84,7 +79,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::SizeF> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2d> {
|
||||
typedef gfx::Vector2d param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -95,7 +89,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2d> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2dF> {
|
||||
typedef gfx::Vector2dF param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -106,7 +99,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2dF> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Rect> {
|
||||
typedef gfx::Rect param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -117,7 +109,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Rect> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::RectF> {
|
||||
typedef gfx::RectF param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -128,7 +119,6 @@ struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::RectF> {
|
||||
template <>
|
||||
struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::ScrollOffset> {
|
||||
typedef gfx::ScrollOffset param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -18,12 +18,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<gfx::Range>::GetSize(base::PickleSizer* s,
|
||||
const gfx::Range& r) {
|
||||
GetParamSize(s, r.start());
|
||||
GetParamSize(s, r.end());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Range>::Write(base::Pickle* m, const gfx::Range& r) {
|
||||
m->WriteUInt32(r.start());
|
||||
m->WriteUInt32(r.end());
|
||||
@ -45,12 +39,6 @@ void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) {
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::GetSize(
|
||||
base::PickleSizer* s, const param_type& p) {
|
||||
MachPortMac mach_port_mac(p.get());
|
||||
GetParamSize(s, mach_port_mac);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Write(
|
||||
base::Pickle* m,
|
||||
const param_type p) {
|
||||
@ -77,14 +65,6 @@ void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Log(
|
||||
}
|
||||
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
|
||||
void ParamTraits<gfx::SelectionBound>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, static_cast<uint32_t>(p.type()));
|
||||
GetParamSize(s, p.edge_top());
|
||||
GetParamSize(s, p.edge_bottom());
|
||||
GetParamSize(s, p.visible());
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::SelectionBound>::Write(base::Pickle* m,
|
||||
const param_type& p) {
|
||||
WriteParam(m, static_cast<uint32_t>(p.type()));
|
||||
@ -128,13 +108,6 @@ void ParamTraits<gfx::SelectionBound>::Log(const param_type& p,
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
|
||||
#include "ui/gfx/ipc/gfx_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
|
@ -27,7 +27,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct GFX_IPC_EXPORT ParamTraits<gfx::Range> {
|
||||
typedef gfx::Range param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -39,7 +38,6 @@ struct GFX_IPC_EXPORT ParamTraits<gfx::Range> {
|
||||
template <>
|
||||
struct GFX_IPC_EXPORT ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort> {
|
||||
typedef gfx::ScopedRefCountedIOSurfaceMachPort param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type p);
|
||||
// Note: Read() passes ownership of the Mach send right from the IPC message
|
||||
// to the ScopedRefCountedIOSurfaceMachPort. Therefore, Read() may only be
|
||||
@ -55,7 +53,6 @@ struct GFX_IPC_EXPORT ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort> {
|
||||
template <>
|
||||
struct GFX_IPC_EXPORT ParamTraits<gfx::SelectionBound> {
|
||||
typedef gfx::SelectionBound param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -52,11 +52,6 @@ struct SkBitmap_Data {
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<SkBitmap>::GetSize(base::PickleSizer* s, const param_type& p) {
|
||||
s->AddData(sizeof(SkBitmap_Data));
|
||||
s->AddData(static_cast<int>(p.getSize()));
|
||||
}
|
||||
|
||||
void ParamTraits<SkBitmap>::Write(base::Pickle* m, const SkBitmap& p) {
|
||||
size_t fixed_size = sizeof(SkBitmap_Data);
|
||||
SkBitmap_Data bmp_data;
|
||||
@ -95,11 +90,6 @@ void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) {
|
||||
l->append("<SkBitmap>");
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Transform>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
s->AddBytes(sizeof(SkMScalar) * 16);
|
||||
}
|
||||
|
||||
void ParamTraits<gfx::Transform>::Write(base::Pickle* m, const param_type& p) {
|
||||
#ifdef SK_MSCALAR_IS_FLOAT
|
||||
float column_major_data[16];
|
||||
|
@ -27,7 +27,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct GFX_SKIA_IPC_EXPORT ParamTraits<SkBitmap> {
|
||||
using param_type = SkBitmap;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
@ -38,7 +37,6 @@ struct GFX_SKIA_IPC_EXPORT ParamTraits<SkBitmap> {
|
||||
template <>
|
||||
struct GFX_SKIA_IPC_EXPORT ParamTraits<gfx::Transform> {
|
||||
using param_type = gfx::Transform;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
@ -5,13 +5,6 @@
|
||||
#include "ui/gfx/ipc/geometry/gfx_param_traits.h"
|
||||
#include "ui/latency/ipc/latency_info_param_traits_macros.h"
|
||||
|
||||
// Generate param traits size methods.
|
||||
#include "ipc/param_traits_size_macros.h"
|
||||
namespace IPC {
|
||||
#undef UI_LATENCY_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_
|
||||
#include "ui/latency/ipc/latency_info_param_traits_macros.h"
|
||||
}
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
namespace IPC {
|
||||
@ -38,17 +31,6 @@ namespace IPC {
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<ui::LatencyInfo>::GetSize(base::PickleSizer* s,
|
||||
const param_type& p) {
|
||||
GetParamSize(s, p.trace_name_);
|
||||
GetParamSize(s, p.latency_components_);
|
||||
GetParamSize(s, p.trace_id_);
|
||||
GetParamSize(s, p.began_);
|
||||
GetParamSize(s, p.terminated_);
|
||||
GetParamSize(s, p.source_event_type_);
|
||||
GetParamSize(s, p.expected_queueing_time_on_dispatch_);
|
||||
}
|
||||
|
||||
void ParamTraits<ui::LatencyInfo>::Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.trace_name_);
|
||||
WriteParam(m, p.latency_components_);
|
||||
|
@ -12,7 +12,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct ParamTraits<ui::LatencyInfo> {
|
||||
typedef ui::LatencyInfo param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
2
url/ipc/OWNERS
Normal file
2
url/ipc/OWNERS
Normal file
@ -0,0 +1,2 @@
|
||||
per-file *_param_traits*.*=set noparent
|
||||
per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
|
@ -8,15 +8,6 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
void ParamTraits<GURL>::GetSize(base::PickleSizer* s, const GURL& p) {
|
||||
if (p.possibly_invalid_spec().length() > url::kMaxURLChars || !p.is_valid()) {
|
||||
GetParamSize(s, std::string());
|
||||
return;
|
||||
}
|
||||
|
||||
GetParamSize(s, p.possibly_invalid_spec());
|
||||
}
|
||||
|
||||
void ParamTraits<GURL>::Write(base::Pickle* m, const GURL& p) {
|
||||
if (p.possibly_invalid_spec().length() > url::kMaxURLChars) {
|
||||
m->WriteString(std::string());
|
||||
|
@ -14,7 +14,6 @@ namespace IPC {
|
||||
template <>
|
||||
struct URL_IPC_EXPORT ParamTraits<GURL> {
|
||||
typedef GURL param_type;
|
||||
static void GetSize(base::PickleSizer* s, const param_type& p);
|
||||
static void Write(base::Pickle* m, const param_type& p);
|
||||
static bool Read(const base::Pickle* m,
|
||||
base::PickleIterator* iter,
|
||||
|
Reference in New Issue
Block a user