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

Unified Diff: mojo/public/cpp/bindings/message.h

Issue 399313007: Mojo: Convert assert()s under mojo/public/cpp/bindings/... to MOJO_DCHECK()s. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: mojo/public/cpp/bindings/message.h
diff --git a/mojo/public/cpp/bindings/message.h b/mojo/public/cpp/bindings/message.h
index beb1cd9036ffb45a9e53f46b2ce7ee059974617a..62801f17ed9ace258156cc1e5a8d40fb02d83802 100644
--- a/mojo/public/cpp/bindings/message.h
+++ b/mojo/public/cpp/bindings/message.h
@@ -5,11 +5,10 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
#define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
-#include <assert.h>
-
#include <vector>
#include "mojo/public/cpp/bindings/lib/message_internal.h"
+#include "mojo/public/cpp/environment/logging.h"
namespace mojo {
@@ -46,12 +45,12 @@ class Message {
// Access the request_id field (if present).
bool has_request_id() const { return data_->header.num_fields >= 3; }
uint64_t request_id() const {
- assert(has_request_id());
+ MOJO_DCHECK(has_request_id());
return static_cast<const internal::MessageHeaderWithRequestID*>(
&data_->header)->request_id;
}
void set_request_id(uint64_t request_id) {
- assert(has_request_id());
+ MOJO_DCHECK(has_request_id());
static_cast<internal::MessageHeaderWithRequestID*>(&data_->header)->
request_id = request_id;
}
@@ -64,7 +63,7 @@ class Message {
return reinterpret_cast<uint8_t*>(data_) + data_->header.num_bytes;
}
uint32_t payload_num_bytes() const {
- assert(data_num_bytes_ >= data_->header.num_bytes);
+ MOJO_DCHECK(data_num_bytes_ >= data_->header.num_bytes);
return data_num_bytes_ - data_->header.num_bytes;
}

Powered by Google App Engine
This is Rietveld 408576698