OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/incoming_endpoint.h" | 5 #include "mojo/edk/system/incoming_endpoint.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/edk/system/channel_endpoint.h" | 8 #include "mojo/edk/system/channel_endpoint.h" |
9 #include "mojo/edk/system/data_pipe.h" | 9 #include "mojo/edk/system/data_pipe.h" |
10 #include "mojo/edk/system/message_in_transit.h" | 10 #include "mojo/edk/system/message_in_transit.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 endpoint_ = nullptr; | 60 endpoint_ = nullptr; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 bool IncomingEndpoint::OnReadMessage(unsigned /*port*/, | 64 bool IncomingEndpoint::OnReadMessage(unsigned /*port*/, |
65 MessageInTransit* message) { | 65 MessageInTransit* message) { |
66 MutexLocker locker(&mutex_); | 66 MutexLocker locker(&mutex_); |
67 if (!endpoint_) | 67 if (!endpoint_) |
68 return false; | 68 return false; |
69 | 69 |
70 message_queue_.AddMessage(make_scoped_ptr(message)); | 70 message_queue_.AddMessage(std::unique_ptr<MessageInTransit>(message)); |
71 return true; | 71 return true; |
72 } | 72 } |
73 | 73 |
74 void IncomingEndpoint::OnDetachFromChannel(unsigned /*port*/) { | 74 void IncomingEndpoint::OnDetachFromChannel(unsigned /*port*/) { |
75 Close(); | 75 Close(); |
76 } | 76 } |
77 | 77 |
78 IncomingEndpoint::~IncomingEndpoint() { | 78 IncomingEndpoint::~IncomingEndpoint() { |
79 } | 79 } |
80 | 80 |
81 } // namespace system | 81 } // namespace system |
82 } // namespace mojo | 82 } // namespace mojo |
OLD | NEW |