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

Unified Diff: mojo/public/cpp/system/buffer.h

Issue 1773403006: [mojo-sdk] Replace assert() usage in bindings with DCHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/system/data_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/system/buffer.h
diff --git a/mojo/public/cpp/system/buffer.h b/mojo/public/cpp/system/buffer.h
index a69fbaa603f4d3095c8f435b94d98ed23553b7a3..607aea1e1409cd6e69970fabe0e79be079c78447 100644
--- a/mojo/public/cpp/system/buffer.h
+++ b/mojo/public/cpp/system/buffer.h
@@ -12,10 +12,10 @@
#ifndef MOJO_PUBLIC_CPP_SYSTEM_BUFFER_H_
#define MOJO_PUBLIC_CPP_SYSTEM_BUFFER_H_
-#include <assert.h>
#include <stdint.h>
#include "base/compiler_specific.h"
+#include "base/logging.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/cpp/system/handle.h"
#include "mojo/public/cpp/system/macros.h"
@@ -45,7 +45,7 @@ inline MojoResult CreateSharedBuffer(
const MojoCreateSharedBufferOptions* options,
uint64_t num_bytes,
ScopedSharedBufferHandle* shared_buffer) {
- assert(shared_buffer);
+ DCHECK(shared_buffer);
SharedBufferHandle handle;
MojoResult rv =
MojoCreateSharedBuffer(options, num_bytes, handle.mutable_value());
@@ -71,7 +71,7 @@ inline MojoResult DuplicateBuffer(
BufferHandleType buffer,
const MojoDuplicateBufferHandleOptions* options,
ScopedHandleBase<BufferHandleType>* new_buffer) {
- assert(new_buffer);
+ DCHECK(new_buffer);
BufferHandleType handle;
MojoResult rv = MojoDuplicateBufferHandle(
buffer.value(), options, handle.mutable_value());
@@ -89,14 +89,14 @@ inline MojoResult MapBuffer(BufferHandleType buffer,
uint64_t num_bytes,
void** pointer,
MojoMapBufferFlags flags) {
- assert(buffer.is_valid());
+ DCHECK(buffer.is_valid());
return MojoMapBuffer(buffer.value(), offset, num_bytes, pointer, flags);
}
// Unmaps a part of a buffer that was previously mapped with |MapBuffer()|.
// See |MojoUnmapBuffer()| for complete documentation.
inline MojoResult UnmapBuffer(void* pointer) {
- assert(pointer);
+ DCHECK(pointer);
return MojoUnmapBuffer(pointer);
}
@@ -115,7 +115,7 @@ class SharedBuffer {
inline SharedBuffer::SharedBuffer(uint64_t num_bytes) {
MojoResult result = CreateSharedBuffer(nullptr, num_bytes, &handle);
ALLOW_UNUSED_LOCAL(result);
- assert(result == MOJO_RESULT_OK);
+ DCHECK_EQ(MOJO_RESULT_OK, result);
}
inline SharedBuffer::SharedBuffer(
@@ -123,7 +123,7 @@ inline SharedBuffer::SharedBuffer(
const MojoCreateSharedBufferOptions& options) {
MojoResult result = CreateSharedBuffer(&options, num_bytes, &handle);
ALLOW_UNUSED_LOCAL(result);
- assert(result == MOJO_RESULT_OK);
+ DCHECK_EQ(MOJO_RESULT_OK, result);
}
inline SharedBuffer::~SharedBuffer() {
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/system/data_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698