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

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 definition of kEmptyMessageSize into .mm file 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"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 storage_length_bytes_(sizeof(MachMessageData)), 42 storage_length_bytes_(sizeof(MachMessageData)),
43 own_storage_(true) { 43 own_storage_(true) {
44 memset(storage_, 0, storage_length_bytes_); 44 memset(storage_, 0, storage_length_bytes_);
45 } 45 }
46 46
47 //============================================================================== 47 //==============================================================================
48 MachMessage::MachMessage(void *storage, size_t storage_length) 48 MachMessage::MachMessage(void *storage, size_t storage_length)
49 : storage_(static_cast<MachMessageData*>(storage)), 49 : storage_(static_cast<MachMessageData*>(storage)),
50 storage_length_bytes_(storage_length), 50 storage_length_bytes_(storage_length),
51 own_storage_(false) { 51 own_storage_(false) {
52 // The size of an empty message with no data.
Peter Kasting 2011/03/26 19:11:47 Nit: Remove comment (already commented in header).
KushalP 2011/03/26 20:23:14 Done.
53 kEmptyMessageSize = sizeof(mach_msg_header_t) +
Peter Kasting 2011/03/26 19:11:47 You should instead place this below "namespace bas
KushalP 2011/03/26 20:23:14 Done.
54 sizeof(mach_msg_body_t) +
55 sizeof(MessageDataPacket);
56
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