Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Side by Side Diff: ipc/mojo/ipc_mojo_param_traits.cc

Issue 1054983003: Revert of Implement IPC::ParamTraits<mojo::MessagePipeHandle> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/mojo/ipc_mojo_param_traits.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ipc/mojo/ipc_mojo_param_traits.h"
6
7 #include "ipc/ipc_message_utils.h"
8 #include "ipc/mojo/ipc_mojo_message_helper.h"
9
10 namespace IPC {
11
12 void ParamTraits<mojo::MessagePipeHandle>::Write(Message* m,
13 const param_type& p) {
14 WriteParam(m, p.is_valid());
15 if (p.is_valid())
16 MojoMessageHelper::WriteMessagePipeTo(m, mojo::ScopedMessagePipeHandle(p));
17 }
18
19 bool ParamTraits<mojo::MessagePipeHandle>::Read(const Message* m,
20 PickleIterator* iter,
21 param_type* r) {
22 bool is_valid;
23 if (!ReadParam(m, iter, &is_valid))
24 return false;
25 if (!is_valid)
26 return true;
27
28 mojo::ScopedMessagePipeHandle handle;
29 if (!MojoMessageHelper::ReadMessagePipeFrom(m, iter, &handle))
30 return false;
31 *r = handle.release();
32 return true;
33 }
34
35 void ParamTraits<mojo::MessagePipeHandle>::Log(const param_type& p,
36 std::string* l) {
37 l->append("mojo::MessagePipeHandle(");
38 LogParam(p.value(), l);
39 l->append(")");
40 }
41
42 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_mojo_param_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698