Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: sandbox/mac/xpc_message_server.cc

Issue 1411523006: mac: Make Mach port scopers better ScopedGenerics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sandbox/mac/launchd_interception_server.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « sandbox/mac/launchd_interception_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698