OLD | NEW |
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/lib/pipe_control_message_handler.h" | 5 #include "mojo/public/cpp/bindings/lib/pipe_control_message_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/public/cpp/bindings/lib/message_builder.h" | 8 #include "mojo/public/cpp/bindings/lib/message_builder.h" |
9 #include "mojo/public/cpp/bindings/lib/pipe_control_message_handler_delegate.h" | 9 #include "mojo/public/cpp/bindings/lib/pipe_control_message_handler_delegate.h" |
10 #include "mojo/public/cpp/bindings/lib/validation_util.h" | 10 #include "mojo/public/cpp/bindings/lib/validation_util.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) { | 49 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) { |
50 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = | 50 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = |
51 reinterpret_cast< | 51 reinterpret_cast< |
52 pipe_control::internal::RunOrClosePipeMessageParams_Data*>( | 52 pipe_control::internal::RunOrClosePipeMessageParams_Data*>( |
53 message->mutable_payload()); | 53 message->mutable_payload()); |
54 params->DecodePointersAndHandles(message->mutable_handles()); | 54 params->DecodePointersAndHandles(message->mutable_handles()); |
55 | 55 |
56 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr; | 56 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr; |
57 Deserialize_(params, ¶ms_ptr); | 57 Deserialize_(params, ¶ms_ptr, nullptr); |
58 | 58 |
59 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) { | 59 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) { |
60 return delegate_->OnPeerAssociatedEndpointClosed( | 60 return delegate_->OnPeerAssociatedEndpointClosed( |
61 params_ptr->input->get_peer_associated_endpoint_closed_event()->id); | 61 params_ptr->input->get_peer_associated_endpoint_closed_event()->id); |
62 } | 62 } |
63 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) { | 63 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) { |
64 return delegate_->OnAssociatedEndpointClosedBeforeSent( | 64 return delegate_->OnAssociatedEndpointClosedBeforeSent( |
65 params_ptr->input->get_associated_endpoint_closed_before_sent_event() | 65 params_ptr->input->get_associated_endpoint_closed_before_sent_event() |
66 ->id); | 66 ->id); |
67 } | 67 } |
68 | 68 |
69 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control " | 69 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control " |
70 << "message. Closing the pipe."; | 70 << "message. Closing the pipe."; |
71 return false; | 71 return false; |
72 } | 72 } |
73 | 73 |
74 } // namespace internal | 74 } // namespace internal |
75 } // namespace mojo | 75 } // namespace mojo |
OLD | NEW |