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 "sandbox/mac/xpc_message_server.h" | 5 #include "sandbox/mac/xpc_message_server.h" |
6 | 6 |
7 #include <bsm/libbsm.h> | 7 #include <bsm/libbsm.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 SendReply(reply); | 97 SendReply(reply); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 mach_port_t XPCMessageServer::GetServerPort() const { | 101 mach_port_t XPCMessageServer::GetServerPort() const { |
102 return server_port_.get(); | 102 return server_port_.get(); |
103 } | 103 } |
104 | 104 |
105 void XPCMessageServer::ReceiveMessage() { | 105 void XPCMessageServer::ReceiveMessage() { |
106 IPCMessage request; | 106 IPCMessage request; |
107 int rv = xpc_pipe_receive(server_port_, &request.xpc); | 107 int rv = xpc_pipe_receive(server_port_.get(), &request.xpc); |
108 if (rv) { | 108 if (rv) { |
109 LOG(ERROR) << "Failed to xpc_pipe_receive(): " << rv; | 109 LOG(ERROR) << "Failed to xpc_pipe_receive(): " << rv; |
110 return; | 110 return; |
111 } | 111 } |
112 | 112 |
113 demuxer_->DemuxMessage(request); | 113 demuxer_->DemuxMessage(request); |
114 | 114 |
115 xpc_release(request.xpc); | 115 xpc_release(request.xpc); |
116 if (reply_message_) { | 116 if (reply_message_) { |
117 xpc_release(reply_message_); | 117 xpc_release(reply_message_); |
118 reply_message_ = NULL; | 118 reply_message_ = NULL; |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 } // namespace sandbox | 122 } // namespace sandbox |
OLD | NEW |