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

Side by Side Diff: util/mach/child_port_handshake.cc

Issue 755313004: Pass Mach message trailers to server handler functions (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years 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 | « util/mach/child_port_handshake.h ('k') | util/mach/child_port_server.h » ('j') | 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 Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 mach_port_t child_port = MACH_PORT_NULL; 240 mach_port_t child_port = MACH_PORT_NULL;
241 std::swap(child_port_, child_port); 241 std::swap(child_port_, child_port);
242 return child_port; 242 return child_port;
243 } 243 }
244 244
245 kern_return_t ChildPortHandshake::HandleChildPortCheckIn( 245 kern_return_t ChildPortHandshake::HandleChildPortCheckIn(
246 child_port_server_t server, 246 child_port_server_t server,
247 const child_port_token_t token, 247 const child_port_token_t token,
248 mach_port_t port, 248 mach_port_t port,
249 mach_msg_type_name_t right_type, 249 mach_msg_type_name_t right_type,
250 const mach_msg_trailer_t* trailer,
250 bool* destroy_complex_request) { 251 bool* destroy_complex_request) {
251 DCHECK_EQ(child_port_, kMachPortNull); 252 DCHECK_EQ(child_port_, kMachPortNull);
252 253
253 if (token != token_) { 254 if (token != token_) {
254 // If the token’s not correct, someone’s attempting to spoof the legitimate 255 // If the token’s not correct, someone’s attempting to spoof the legitimate
255 // client. 256 // client.
256 LOG(WARNING) << "ignoring incorrect token"; 257 LOG(WARNING) << "ignoring incorrect token";
257 *destroy_complex_request = true; 258 *destroy_complex_request = true;
258 } else { 259 } else {
259 checked_in_ = true; 260 checked_in_ = true;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 bootstrap_look_up(bootstrap_port, service_name.c_str(), &server_port); 327 bootstrap_look_up(bootstrap_port, service_name.c_str(), &server_port);
327 BOOTSTRAP_CHECK(kr == BOOTSTRAP_SUCCESS, kr) << "bootstrap_look_up"; 328 BOOTSTRAP_CHECK(kr == BOOTSTRAP_SUCCESS, kr) << "bootstrap_look_up";
328 base::mac::ScopedMachSendRight server_port_owner(server_port); 329 base::mac::ScopedMachSendRight server_port_owner(server_port);
329 330
330 // Check in with the server. 331 // Check in with the server.
331 kr = child_port_check_in(server_port, token, port, right_type); 332 kr = child_port_check_in(server_port, token, port, right_type);
332 MACH_CHECK(kr == KERN_SUCCESS, kr) << "child_port_check_in"; 333 MACH_CHECK(kr == KERN_SUCCESS, kr) << "child_port_check_in";
333 } 334 }
334 335
335 } // namespace crashpad 336 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/mach/child_port_handshake.h ('k') | util/mach/child_port_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698