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

Side by Side Diff: mojo/public/system/core_cpp.h

Issue 140503005: Mojo: foo_[0-9] -> foo[0-9]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | mojo/public/tests/system/core_cpp_unittest.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_PUBLIC_SYSTEM_CORE_CPP_H_ 5 #ifndef MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
6 #define MOJO_PUBLIC_SYSTEM_CORE_CPP_H_ 6 #define MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
7 7
8 #include <assert.h> 8 #include <assert.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 MOJO_COMPILE_ASSERT(sizeof(MessagePipeHandle) == sizeof(Handle), 179 MOJO_COMPILE_ASSERT(sizeof(MessagePipeHandle) == sizeof(Handle),
180 bad_size_for_cpp_MessagePipeHandle); 180 bad_size_for_cpp_MessagePipeHandle);
181 181
182 typedef ScopedHandleBase<MessagePipeHandle> ScopedMessagePipeHandle; 182 typedef ScopedHandleBase<MessagePipeHandle> ScopedMessagePipeHandle;
183 MOJO_COMPILE_ASSERT(sizeof(ScopedMessagePipeHandle) == 183 MOJO_COMPILE_ASSERT(sizeof(ScopedMessagePipeHandle) ==
184 sizeof(MessagePipeHandle), 184 sizeof(MessagePipeHandle),
185 bad_size_for_cpp_ScopedMessagePipeHandle); 185 bad_size_for_cpp_ScopedMessagePipeHandle);
186 186
187 // TODO(vtl): In C++11, we could instead return a pair of 187 // TODO(vtl): In C++11, we could instead return a pair of
188 // |ScopedMessagePipeHandle|s. 188 // |ScopedMessagePipeHandle|s.
189 inline void CreateMessagePipe(ScopedMessagePipeHandle* message_pipe_0, 189 inline void CreateMessagePipe(ScopedMessagePipeHandle* message_pipe0,
190 ScopedMessagePipeHandle* message_pipe_1) { 190 ScopedMessagePipeHandle* message_pipe1) {
191 assert(message_pipe_0); 191 assert(message_pipe0);
192 assert(message_pipe_1); 192 assert(message_pipe1);
193 MessagePipeHandle h_0; 193 MessagePipeHandle h0;
194 MessagePipeHandle h_1; 194 MessagePipeHandle h1;
195 MojoResult result MOJO_ALLOW_UNUSED = 195 MojoResult result MOJO_ALLOW_UNUSED =
196 MojoCreateMessagePipe(h_0.mutable_value(), h_1.mutable_value()); 196 MojoCreateMessagePipe(h0.mutable_value(), h1.mutable_value());
197 assert(result == MOJO_RESULT_OK); 197 assert(result == MOJO_RESULT_OK);
198 message_pipe_0->reset(h_0); 198 message_pipe0->reset(h0);
199 message_pipe_1->reset(h_1); 199 message_pipe1->reset(h1);
200 } 200 }
201 201
202 class MessagePipe { 202 class MessagePipe {
203 public: 203 public:
204 MessagePipe(); 204 MessagePipe();
205 ~MessagePipe(); 205 ~MessagePipe();
206 206
207 ScopedMessagePipeHandle handle0; 207 ScopedMessagePipeHandle handle0;
208 ScopedMessagePipeHandle handle1; 208 ScopedMessagePipeHandle handle1;
209 }; 209 };
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 326
327 inline MojoResult EndReadDataRaw(DataPipeConsumerHandle data_pipe_consumer, 327 inline MojoResult EndReadDataRaw(DataPipeConsumerHandle data_pipe_consumer,
328 uint32_t num_bytes_read) { 328 uint32_t num_bytes_read) {
329 return MojoEndReadData(data_pipe_consumer.value(), num_bytes_read); 329 return MojoEndReadData(data_pipe_consumer.value(), num_bytes_read);
330 } 330 }
331 331
332 } // namespace mojo 332 } // namespace mojo
333 333
334 #endif // MOJO_PUBLIC_SYSTEM_CORE_CPP_H_ 334 #endif // MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/public/tests/system/core_cpp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698