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/control_message_handler.h" | 5 #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 interface_control::internal::RunOrClosePipeMessageParams_Data* params = | 134 interface_control::internal::RunOrClosePipeMessageParams_Data* params = |
135 reinterpret_cast< | 135 reinterpret_cast< |
136 interface_control::internal::RunOrClosePipeMessageParams_Data*>( | 136 interface_control::internal::RunOrClosePipeMessageParams_Data*>( |
137 message->mutable_payload()); | 137 message->mutable_payload()); |
138 interface_control::RunOrClosePipeMessageParamsPtr params_ptr; | 138 interface_control::RunOrClosePipeMessageParamsPtr params_ptr; |
139 Deserialize<interface_control::RunOrClosePipeMessageParamsDataView>( | 139 Deserialize<interface_control::RunOrClosePipeMessageParamsDataView>( |
140 params, ¶ms_ptr, &context_); | 140 params, ¶ms_ptr, &context_); |
141 auto& input = *params_ptr->input; | 141 auto& input = *params_ptr->input; |
142 if (input.is_require_version()) | 142 if (input.is_require_version()) |
143 return interface_version_ >= input.get_require_version()->version; | 143 return interface_version_ >= input.get_require_version()->version; |
| 144 else if (input.is_send_disconnect_reason()) { |
| 145 disconnect_custom_reason_ = |
| 146 input.get_send_disconnect_reason()->custom_reason; |
| 147 disconnect_description_ = |
| 148 std::move(input.get_send_disconnect_reason()->description); |
| 149 return true; |
| 150 } |
144 | 151 |
145 return false; | 152 return false; |
146 } | 153 } |
147 | 154 |
148 } // namespace internal | 155 } // namespace internal |
149 } // namespace mojo | 156 } // namespace mojo |
OLD | NEW |