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

Side by Side Diff: base/mach_ipc_mac.mm

Issue 6688056: Updating DCHECK() to DCHECK_GE() in base/ dir (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Moving kEmptyMessageSize into namespace base Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/mach_ipc_mac.h" 5 #include "base/mach_ipc_mac.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 // static
15 const size_t kEmptyMessageSize = sizeof(mach_msg_header_t) +
Peter Kasting 2011/03/26 23:48:24 Sorry, I meant to say "MachSendMessage::kEmptyMess
KushalP 2011/03/27 00:25:15 Done.
16 sizeof(mach_msg_body_t) +
17 sizeof(MessageDataPacket);
18
14 //============================================================================== 19 //==============================================================================
15 MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { 20 MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() {
16 Initialize(message_id); 21 Initialize(message_id);
17 } 22 }
18 23
19 MachSendMessage::MachSendMessage(void *storage, size_t storage_length, 24 MachSendMessage::MachSendMessage(void *storage, size_t storage_length,
20 int32_t message_id) 25 int32_t message_id)
21 : MachMessage(storage, storage_length) { 26 : MachMessage(storage, storage_length) {
22 Initialize(message_id); 27 Initialize(message_id);
23 } 28 }
(...skipping 19 matching lines...) Expand all
43 own_storage_(true) { 48 own_storage_(true) {
44 memset(storage_, 0, storage_length_bytes_); 49 memset(storage_, 0, storage_length_bytes_);
45 } 50 }
46 51
47 //============================================================================== 52 //==============================================================================
48 MachMessage::MachMessage(void *storage, size_t storage_length) 53 MachMessage::MachMessage(void *storage, size_t storage_length)
49 : storage_(static_cast<MachMessageData*>(storage)), 54 : storage_(static_cast<MachMessageData*>(storage)),
50 storage_length_bytes_(storage_length), 55 storage_length_bytes_(storage_length),
51 own_storage_(false) { 56 own_storage_(false) {
52 DCHECK(storage); 57 DCHECK(storage);
53 DCHECK(storage_length >= kEmptyMessageSize); 58 DCHECK_GE(storage_length, kEmptyMessageSize);
54 } 59 }
55 60
56 //============================================================================== 61 //==============================================================================
57 MachMessage::~MachMessage() { 62 MachMessage::~MachMessage() {
58 if (own_storage_) { 63 if (own_storage_) {
59 delete storage_; 64 delete storage_;
60 storage_ = NULL; 65 storage_ = NULL;
61 } 66 }
62 } 67 }
63 68
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 message.Head()->msgh_size, 317 message.Head()->msgh_size,
313 0, 318 0,
314 MACH_PORT_NULL, 319 MACH_PORT_NULL,
315 timeout, // timeout in ms 320 timeout, // timeout in ms
316 MACH_PORT_NULL); 321 MACH_PORT_NULL);
317 322
318 return result; 323 return result;
319 } 324 }
320 325
321 } // namespace base 326 } // namespace base
OLDNEW
« base/mach_ipc_mac.h ('K') | « base/mach_ipc_mac.h ('k') | base/message_pump_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698