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

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

Issue 736493007: MachMessageServer: don’t deal with MACH_SEND_TRAILER (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: " 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 | « no previous file | 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 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 mach_msg_size_t trailer_alloc = REQUESTED_TRAILER_SIZE(options); 104 mach_msg_size_t trailer_alloc = REQUESTED_TRAILER_SIZE(options);
105 mach_msg_size_t max_request_size = interface->MachMessageServerRequestSize(); 105 mach_msg_size_t max_request_size = interface->MachMessageServerRequestSize();
106 mach_msg_size_t request_alloc = round_page(max_request_size + trailer_alloc); 106 mach_msg_size_t request_alloc = round_page(max_request_size + trailer_alloc);
107 mach_msg_size_t request_size = (options & MACH_RCV_LARGE) 107 mach_msg_size_t request_size = (options & MACH_RCV_LARGE)
108 ? request_alloc 108 ? request_alloc
109 : max_request_size + trailer_alloc; 109 : max_request_size + trailer_alloc;
110 110
111 mach_msg_size_t max_reply_size = interface->MachMessageServerReplySize(); 111 mach_msg_size_t max_reply_size = interface->MachMessageServerReplySize();
112 mach_msg_size_t reply_alloc = round_page( 112
113 (options & MACH_SEND_TRAILER) ? (max_reply_size + MAX_TRAILER_SIZE) 113 // mach_msg_server() and mach_msg_server_once() would consider whether
114 : max_reply_size); 114 // |options| contains MACH_SEND_TRAILER and include MAX_TRAILER_SIZE in this
115 // computation if it does, but that option is ineffective on OS X.
116 mach_msg_size_t reply_alloc = round_page(max_reply_size);
115 117
116 kern_return_t kr; 118 kern_return_t kr;
117 119
118 do { 120 do {
119 mach_msg_size_t this_request_alloc = request_alloc; 121 mach_msg_size_t this_request_alloc = request_alloc;
120 mach_msg_size_t this_request_size = request_size; 122 mach_msg_size_t this_request_size = request_size;
121 123
122 base::mac::ScopedMachVM request_scoper; 124 base::mac::ScopedMachVM request_scoper;
123 mach_msg_header_t* request_header = nullptr; 125 mach_msg_header_t* request_header = nullptr;
124 126
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // persistent mode, and just return success when not in persistent mode. 259 // persistent mode, and just return success when not in persistent mode.
258 return (persistent == kPersistent) ? MACH_RCV_TIMED_OUT : kr; 260 return (persistent == kPersistent) ? MACH_RCV_TIMED_OUT : kr;
259 } 261 }
260 } 262 }
261 } while (persistent == kPersistent); 263 } while (persistent == kPersistent);
262 264
263 return kr; 265 return kr;
264 } 266 }
265 267
266 } // namespace crashpad 268 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698