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

Side by Side Diff: mojo/system/transport_data.cc

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/simple_dispatcher_unittest.cc ('k') | 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 Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/system/transport_data.h" 5 #include "mojo/system/transport_data.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 size_t size = handle_table[i].size; 290 size_t size = handle_table[i].size;
291 if (size > kMaxSerializedDispatcherSize || size > buffer_size) 291 if (size > kMaxSerializedDispatcherSize || size > buffer_size)
292 return kInvalidSerializedDispatcher; 292 return kInvalidSerializedDispatcher;
293 293
294 // Note: This is an overflow-safe check for |offset + size > buffer_size| 294 // Note: This is an overflow-safe check for |offset + size > buffer_size|
295 // (we know that |size <= buffer_size| from the previous check). 295 // (we know that |size <= buffer_size| from the previous check).
296 if (offset > buffer_size - size) 296 if (offset > buffer_size - size)
297 return kInvalidSerializedDispatcher; 297 return kInvalidSerializedDispatcher;
298 } 298 }
299 299
300 return NULL; 300 return nullptr;
301 } 301 }
302 302
303 // static 303 // static
304 void TransportData::GetPlatformHandleTable(const void* transport_data_buffer, 304 void TransportData::GetPlatformHandleTable(const void* transport_data_buffer,
305 size_t* num_platform_handles, 305 size_t* num_platform_handles,
306 const void** platform_handle_table) { 306 const void** platform_handle_table) {
307 DCHECK(transport_data_buffer); 307 DCHECK(transport_data_buffer);
308 DCHECK(num_platform_handles); 308 DCHECK(num_platform_handles);
309 DCHECK(platform_handle_table); 309 DCHECK(platform_handle_table);
310 310
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 const void* source = static_cast<const char*>(buffer) + offset; 342 const void* source = static_cast<const char*>(buffer) + offset;
343 (*dispatchers)[i] = Dispatcher::TransportDataAccess::Deserialize( 343 (*dispatchers)[i] = Dispatcher::TransportDataAccess::Deserialize(
344 channel, handle_table[i].type, source, size, platform_handles.get()); 344 channel, handle_table[i].type, source, size, platform_handles.get());
345 } 345 }
346 346
347 return dispatchers.Pass(); 347 return dispatchers.Pass();
348 } 348 }
349 349
350 } // namespace system 350 } // namespace system
351 } // namespace mojo 351 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/simple_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698