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::embedder::ScopedPlatformHandle; | 21 using mojo::platform::ScopedPlatformHandle; |
22 using mojo::util::RefPtr; | 22 using mojo::util::RefPtr; |
23 | 23 |
24 namespace mojo { | 24 namespace mojo { |
25 namespace system { | 25 namespace system { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 bool ValidateIncomingMessage(size_t element_num_bytes, | 29 bool ValidateIncomingMessage(size_t element_num_bytes, |
30 size_t capacity_num_bytes, | 30 size_t capacity_num_bytes, |
31 size_t consumer_num_bytes, | 31 size_t consumer_num_bytes, |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 DCHECK(channel_endpoint_); | 423 DCHECK(channel_endpoint_); |
424 SetConsumerClosed(); | 424 SetConsumerClosed(); |
425 channel_endpoint_->DetachFromClient(); | 425 channel_endpoint_->DetachFromClient(); |
426 channel_endpoint_ = nullptr; | 426 channel_endpoint_ = nullptr; |
427 if (!producer_in_two_phase_write()) | 427 if (!producer_in_two_phase_write()) |
428 DestroyBuffer(); | 428 DestroyBuffer(); |
429 } | 429 } |
430 | 430 |
431 } // namespace system | 431 } // namespace system |
432 } // namespace mojo | 432 } // namespace mojo |
OLD | NEW |