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

Side by Side Diff: mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc

Issue 2660733002: Mojo C++ bindings: introduce an optional array to store transferred interface IDs in messages. (Closed)
Patch Set: . Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" 5 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "mojo/public/cpp/bindings/lib/message_builder.h" 12 #include "mojo/public/cpp/bindings/lib/message_builder.h"
13 #include "mojo/public/cpp/bindings/lib/serialization.h" 13 #include "mojo/public/cpp/bindings/lib/serialization.h"
14 #include "mojo/public/interfaces/bindings/pipe_control_messages.mojom.h" 14 #include "mojo/public/interfaces/bindings/pipe_control_messages.mojom.h"
15 15
16 namespace mojo { 16 namespace mojo {
17 namespace { 17 namespace {
18 18
19 Message ConstructRunOrClosePipeMessage( 19 Message ConstructRunOrClosePipeMessage(
20 pipe_control::RunOrClosePipeInputPtr input_ptr) { 20 pipe_control::RunOrClosePipeInputPtr input_ptr) {
21 internal::SerializationContext context; 21 internal::SerializationContext context;
22 22
23 auto params_ptr = pipe_control::RunOrClosePipeMessageParams::New(); 23 auto params_ptr = pipe_control::RunOrClosePipeMessageParams::New();
24 params_ptr->input = std::move(input_ptr); 24 params_ptr->input = std::move(input_ptr);
25 25
26 size_t size = internal::PrepareToSerialize< 26 size_t size = internal::PrepareToSerialize<
27 pipe_control::RunOrClosePipeMessageParamsDataView>(params_ptr, &context); 27 pipe_control::RunOrClosePipeMessageParamsDataView>(params_ptr, &context);
28 internal::MessageBuilder builder(pipe_control::kRunOrClosePipeMessageId, 28 internal::MessageBuilder builder(pipe_control::kRunOrClosePipeMessageId, 0,
29 size); 29 size, 0);
30 30
31 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = nullptr; 31 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = nullptr;
32 internal::Serialize<pipe_control::RunOrClosePipeMessageParamsDataView>( 32 internal::Serialize<pipe_control::RunOrClosePipeMessageParamsDataView>(
33 params_ptr, builder.buffer(), &params, &context); 33 params_ptr, builder.buffer(), &params, &context);
34 builder.message()->set_interface_id(kInvalidInterfaceId); 34 builder.message()->set_interface_id(kInvalidInterfaceId);
35 return std::move(*builder.message()); 35 return std::move(*builder.message());
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 event->disconnect_reason->description = reason->description; 74 event->disconnect_reason->description = reason->description;
75 } 75 }
76 76
77 auto input = pipe_control::RunOrClosePipeInput::New(); 77 auto input = pipe_control::RunOrClosePipeInput::New();
78 input->set_peer_associated_endpoint_closed_event(std::move(event)); 78 input->set_peer_associated_endpoint_closed_event(std::move(event));
79 79
80 return ConstructRunOrClosePipeMessage(std::move(input)); 80 return ConstructRunOrClosePipeMessage(std::move(input));
81 } 81 }
82 82
83 } // namespace mojo 83 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc ('k') | mojo/public/cpp/bindings/lib/serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698