| Index: content/common/content_param_traits.cc
|
| diff --git a/content/common/content_param_traits.cc b/content/common/content_param_traits.cc
|
| index 514473020a17eed4f9447e0eabc6c718e35567ce..3586c6c06fe58fea8ca0ad7d0462d6a6e43cdb2a 100644
|
| --- a/content/common/content_param_traits.cc
|
| +++ b/content/common/content_param_traits.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "content/common/accessibility_mode.h"
|
| #include "content/common/message_port.h"
|
| +#include "ipc/ipc_mojo_message_helper.h"
|
| #include "ipc/ipc_mojo_param_traits.h"
|
| #include "net/base/ip_endpoint.h"
|
| #include "ui/events/blink/web_input_event_traits.h"
|
| @@ -112,6 +113,52 @@ bool ParamTraits<content::AccessibilityMode>::Read(const base::Pickle* m,
|
|
|
| void ParamTraits<content::AccessibilityMode>::Log(const param_type& p,
|
| std::string* l) {}
|
| +
|
| +void ParamTraits<storage::mojom::BlobPtr>::GetSize(base::PickleSizer* s,
|
| + const param_type& p) {
|
| + GetParamSize(s, p.is_bound());
|
| + if (p.is_bound()) {
|
| + s->AddUInt32();
|
| + s->AddAttachment();
|
| + }
|
| +}
|
| +
|
| +void ParamTraits<storage::mojom::BlobPtr>::Write(base::Pickle* m,
|
| + const param_type& p) {
|
| + WriteParam(m, p.is_bound());
|
| + if (p.is_bound()) {
|
| + storage::mojom::BlobPtr clone;
|
| + p->Clone(MakeRequest(&clone));
|
| + auto info = clone.PassInterface();
|
| + m->WriteUInt32(info.version());
|
| + MojoMessageHelper::WriteMessagePipeTo(m, info.PassHandle());
|
| + }
|
| +}
|
| +
|
| +bool ParamTraits<storage::mojom::BlobPtr>::Read(const base::Pickle* m,
|
| + base::PickleIterator* iter,
|
| + param_type* r) {
|
| + bool is_valid;
|
| + if (!ReadParam(m, iter, &is_valid))
|
| + return false;
|
| + if (!is_valid)
|
| + return true;
|
| +
|
| + uint32_t version;
|
| + if (!ReadParam(m, iter, &version))
|
| + return false;
|
| + mojo::ScopedMessagePipeHandle handle;
|
| + if (!MojoMessageHelper::ReadMessagePipeFrom(m, iter, &handle))
|
| + return false;
|
| + DCHECK(handle.is_valid());
|
| + r->Bind(
|
| + mojo::InterfacePtrInfo<storage::mojom::Blob>(std::move(handle), version));
|
| + return true;
|
| +}
|
| +
|
| +void ParamTraits<storage::mojom::BlobPtr>::Log(const param_type& p,
|
| + std::string* l) {}
|
| +
|
| } // namespace IPC
|
|
|
| // Generate param traits size methods.
|
|
|