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

Side by Side Diff: mojo/system/message_in_transit.h

Issue 597413002: Mojo: NULL -> nullptr in mojo/system and mojo/embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT_TRUE Created 6 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 | « mojo/system/memory_unittest.cc ('k') | mojo/system/message_pipe.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 5 #ifndef MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 // API parallel to that for |MessageInTransit| itself (mostly getters for 100 // API parallel to that for |MessageInTransit| itself (mostly getters for
101 // header data). 101 // header data).
102 const void* main_buffer() const { return buffer_; } 102 const void* main_buffer() const { return buffer_; }
103 size_t main_buffer_size() const { 103 size_t main_buffer_size() const {
104 return RoundUpMessageAlignment(sizeof(Header) + header()->num_bytes); 104 return RoundUpMessageAlignment(sizeof(Header) + header()->num_bytes);
105 } 105 }
106 const void* transport_data_buffer() const { 106 const void* transport_data_buffer() const {
107 return (total_size() > main_buffer_size()) 107 return (total_size() > main_buffer_size())
108 ? static_cast<const char*>(buffer_) + main_buffer_size() 108 ? static_cast<const char*>(buffer_) + main_buffer_size()
109 : NULL; 109 : nullptr;
110 } 110 }
111 size_t transport_data_buffer_size() const { 111 size_t transport_data_buffer_size() const {
112 return total_size() - main_buffer_size(); 112 return total_size() - main_buffer_size();
113 } 113 }
114 size_t total_size() const { return header()->total_size; } 114 size_t total_size() const { return header()->total_size; }
115 uint32_t num_bytes() const { return header()->num_bytes; } 115 uint32_t num_bytes() const { return header()->num_bytes; }
116 const void* bytes() const { 116 const void* bytes() const {
117 return static_cast<const char*>(buffer_) + sizeof(Header); 117 return static_cast<const char*>(buffer_) + sizeof(Header);
118 } 118 }
119 Type type() const { return header()->type; } 119 Type type() const { return header()->type; }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // some reason.) 258 // some reason.)
259 scoped_ptr<DispatcherVector> dispatchers_; 259 scoped_ptr<DispatcherVector> dispatchers_;
260 260
261 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); 261 DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
262 }; 262 };
263 263
264 } // namespace system 264 } // namespace system
265 } // namespace mojo 265 } // namespace mojo
266 266
267 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 267 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
OLDNEW
« no previous file with comments | « mojo/system/memory_unittest.cc ('k') | mojo/system/message_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698