| 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/edk/system/remote_consumer_data_pipe_impl.h" | 5 #include "mojo/edk/system/remote_consumer_data_pipe_impl.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "mojo/edk/system/channel.h" | 14 #include "mojo/edk/system/channel.h" |
| 15 #include "mojo/edk/system/channel_endpoint.h" | 15 #include "mojo/edk/system/channel_endpoint.h" |
| 16 #include "mojo/edk/system/configuration.h" | 16 #include "mojo/edk/system/configuration.h" |
| 17 #include "mojo/edk/system/data_pipe.h" | 17 #include "mojo/edk/system/data_pipe.h" |
| 18 #include "mojo/edk/system/message_in_transit.h" | 18 #include "mojo/edk/system/message_in_transit.h" |
| 19 #include "mojo/edk/system/remote_data_pipe_ack.h" | 19 #include "mojo/edk/system/remote_data_pipe_ack.h" |
| 20 | 20 |
| 21 using mojo::util::RefPtr; |
| 22 |
| 21 namespace mojo { | 23 namespace mojo { |
| 22 namespace system { | 24 namespace system { |
| 23 | 25 |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 bool ValidateIncomingMessage(size_t element_num_bytes, | 28 bool ValidateIncomingMessage(size_t element_num_bytes, |
| 27 size_t capacity_num_bytes, | 29 size_t capacity_num_bytes, |
| 28 size_t consumer_num_bytes, | 30 size_t consumer_num_bytes, |
| 29 const MessageInTransit* message) { | 31 const MessageInTransit* message) { |
| 30 // We should only receive endpoint client messages. | 32 // We should only receive endpoint client messages. |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 DCHECK(channel_endpoint_); | 422 DCHECK(channel_endpoint_); |
| 421 SetConsumerClosed(); | 423 SetConsumerClosed(); |
| 422 channel_endpoint_->DetachFromClient(); | 424 channel_endpoint_->DetachFromClient(); |
| 423 channel_endpoint_ = nullptr; | 425 channel_endpoint_ = nullptr; |
| 424 if (!producer_in_two_phase_write()) | 426 if (!producer_in_two_phase_write()) |
| 425 DestroyBuffer(); | 427 DestroyBuffer(); |
| 426 } | 428 } |
| 427 | 429 |
| 428 } // namespace system | 430 } // namespace system |
| 429 } // namespace mojo | 431 } // namespace mojo |
| OLD | NEW |