OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/edk/system/channel.h" | 5 #include "mojo/edk/system/channel.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // error, since it may indicate a buggy (or hostile) remote process. Don't | 401 // error, since it may indicate a buggy (or hostile) remote process. Don't |
402 // die even for Debug builds, since handling this properly needs to be | 402 // die even for Debug builds, since handling this properly needs to be |
403 // tested (TODO(vtl)). | 403 // tested (TODO(vtl)). |
404 DLOG(ERROR) << "This should not happen under normal operation."; | 404 DLOG(ERROR) << "This should not happen under normal operation."; |
405 return; | 405 return; |
406 } | 406 } |
407 | 407 |
408 std::unique_ptr<MessageInTransit> message(new MessageInTransit(message_view)); | 408 std::unique_ptr<MessageInTransit> message(new MessageInTransit(message_view)); |
409 if (message_view.transport_data_buffer_size() > 0) { | 409 if (message_view.transport_data_buffer_size() > 0) { |
410 DCHECK(message_view.transport_data_buffer()); | 410 DCHECK(message_view.transport_data_buffer()); |
411 message->SetDispatchers(TransportData::DeserializeDispatchers( | 411 message->SetHandles(TransportData::DeserializeHandles( |
412 message_view.transport_data_buffer(), | 412 message_view.transport_data_buffer(), |
413 message_view.transport_data_buffer_size(), std::move(platform_handles), | 413 message_view.transport_data_buffer_size(), std::move(platform_handles), |
414 this)); | 414 this)); |
415 } | 415 } |
416 | 416 |
417 endpoint->OnReadMessage(std::move(message)); | 417 endpoint->OnReadMessage(std::move(message)); |
418 } | 418 } |
419 | 419 |
420 void Channel::OnReadMessageForChannel( | 420 void Channel::OnReadMessageForChannel( |
421 const MessageInTransit::View& message_view, | 421 const MessageInTransit::View& message_view, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 << ", local ID " << local_id << ", remote ID " << remote_id; | 646 << ", local ID " << local_id << ", remote ID " << remote_id; |
647 std::unique_ptr<MessageInTransit> message(new MessageInTransit( | 647 std::unique_ptr<MessageInTransit> message(new MessageInTransit( |
648 MessageInTransit::Type::CHANNEL, subtype, num_bytes, bytes)); | 648 MessageInTransit::Type::CHANNEL, subtype, num_bytes, bytes)); |
649 message->set_source_id(local_id); | 649 message->set_source_id(local_id); |
650 message->set_destination_id(remote_id); | 650 message->set_destination_id(remote_id); |
651 return WriteMessage(std::move(message)); | 651 return WriteMessage(std::move(message)); |
652 } | 652 } |
653 | 653 |
654 } // namespace system | 654 } // namespace system |
655 } // namespace mojo | 655 } // namespace mojo |
OLD | NEW |