| Index: content/public/common/common_param_traits.cc
|
| diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc
|
| index 286e6621cc6212cf727ba636c44d4df4a0ba6ceb..2a990c4c3119f0b722962802d60189106ef7c496 100644
|
| --- a/content/public/common/common_param_traits.cc
|
| +++ b/content/public/common/common_param_traits.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/containers/stack_container.h"
|
| #include "content/public/common/content_constants.h"
|
| #include "content/public/common/page_state.h"
|
| #include "content/public/common/referrer.h"
|
| @@ -124,25 +125,30 @@ void ParamTraits<net::IPEndPoint>::Log(const param_type& p, std::string* l) {
|
|
|
| void ParamTraits<net::IPAddress>::GetSize(base::PickleSizer* s,
|
| const param_type& p) {
|
| - GetParamSize(s, p.bytes());
|
| + 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) {
|
| - WriteParam(m, p.bytes());
|
| + base::StackVector<uint8_t, 16> bytes;
|
| + for (uint8_t byte : p.bytes())
|
| + bytes->push_back(byte);
|
| + WriteParam(m, bytes);
|
| }
|
|
|
| bool ParamTraits<net::IPAddress>::Read(const base::Pickle* m,
|
| base::PickleIterator* iter,
|
| param_type* p) {
|
| - std::vector<uint8_t> bytes;
|
| + base::StackVector<uint8_t, 16> bytes;
|
| if (!ReadParam(m, iter, &bytes))
|
| return false;
|
| - if (bytes.size() &&
|
| - bytes.size() != net::IPAddress::kIPv4AddressSize &&
|
| - bytes.size() != net::IPAddress::kIPv6AddressSize) {
|
| + if (bytes->size() && bytes->size() != net::IPAddress::kIPv4AddressSize &&
|
| + bytes->size() != net::IPAddress::kIPv6AddressSize) {
|
| return false;
|
| }
|
| - *p = net::IPAddress(bytes);
|
| + *p = net::IPAddress(bytes->data(), bytes->size());
|
| return true;
|
| }
|
|
|
|
|