Chromium Code Reviews| Index: cc/ipc/cc_param_traits.cc |
| diff --git a/cc/ipc/cc_param_traits.cc b/cc/ipc/cc_param_traits.cc |
| index 02483340a769547ea3cf350089b486d832ce4eef..c9de2ca63847ea146925ecec76ffa27a209767da 100644 |
| --- a/cc/ipc/cc_param_traits.cc |
| +++ b/cc/ipc/cc_param_traits.cc |
| @@ -994,6 +994,89 @@ void ParamTraits<cc::BeginFrameAck>::Log(const param_type& p, std::string* l) { |
| l->append(")"); |
| } |
| +void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::GetSize( |
| + base::PickleSizer* s, |
| + const param_type& p) { |
| + GetParamSize(s, p.unique_id_hash_code); |
| +} |
| + |
| +void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Write( |
| + base::Pickle* m, |
| + const param_type& p) { |
| + m->WriteInt(p.unique_id_hash_code); |
| +} |
| + |
| +bool ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Read( |
| + const base::Pickle* m, |
| + base::PickleIterator* iter, |
| + param_type* p) { |
| + int32_t unique_id_hash_code; |
| + if (!iter->ReadInt(&unique_id_hash_code)) |
| + return false; |
| + new (p) net::MutableNetworkTrafficAnnotationTag({unique_id_hash_code}); |
|
yzshen1
2017/06/01 16:04:27
This means the destructor of the original contents
Ramin Halavati
2017/06/02 07:47:06
Done.
|
| + return true; |
| +} |
| + |
| +void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Log( |
| + const param_type& p, |
| + std::string* l) { |
| + l->append("("); |
| + LogParam(p.unique_id_hash_code, l); |
| + l->append(")"); |
| +} |
| + |
| +void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::GetSize( |
| + base::PickleSizer* s, |
| + const param_type& p) { |
| + GetParamSize(s, p.unique_id_hash_code); |
| +#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON) |
| + GetParamSize(s, p.completing_id_hash_code); |
| +#endif |
| +} |
| + |
| +void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Write( |
| + base::Pickle* m, |
| + const param_type& p) { |
| + m->WriteInt(p.unique_id_hash_code); |
| + |
| +// |completing_id_hash_code| is only stored and needed when DCHECKs are on. |
| +#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON) |
| + m->WriteInt(p.completing_id_hash_code); |
| +#endif |
| +} |
| + |
| +bool ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Read( |
| + const base::Pickle* m, |
| + base::PickleIterator* iter, |
| + param_type* p) { |
| + int32_t unique_id_hash_code; |
| + if (!iter->ReadInt(&unique_id_hash_code)) |
| + return false; |
| +#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON) |
| + int32_t completing_id_hash_code; |
| + if (!iter->ReadInt(&completing_id_hash_code)) |
| + return false; |
| + new (p) net::MutablePartialNetworkTrafficAnnotationTag( |
|
yzshen1
2017/06/01 16:04:26
ditto
Ramin Halavati
2017/06/02 07:47:06
Done.
|
| + {unique_id_hash_code, completing_id_hash_code}); |
| +#else |
| + new (p) net::MutablePartialNetworkTrafficAnnotationTag({unique_id_hash_code}); |
| +#endif |
| + |
| + return true; |
| +} |
| + |
| +void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Log( |
| + const param_type& p, |
| + std::string* l) { |
| + l->append("("); |
| + LogParam(p.unique_id_hash_code, l); |
| +#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON) |
| + l->append(", "); |
| + LogParam(p.completing_id_hash_code, l); |
| +#endif |
| + l->append(")"); |
| +} |
| + |
| } // namespace IPC |
| // Generate param traits size methods. |