Index: mojo/public/cpp/bindings/message.h |
diff --git a/mojo/public/cpp/bindings/message.h b/mojo/public/cpp/bindings/message.h |
index e6c42058ac23d34c5183d1ccfc45e9e2fcb5e496..5ed0586fb88e006f0e67055f9c93d5fd7b282176 100644 |
--- a/mojo/public/cpp/bindings/message.h |
+++ b/mojo/public/cpp/bindings/message.h |
@@ -63,6 +63,10 @@ class Message { |
uint8_t* mutable_payload() { |
return reinterpret_cast<uint8_t*>(data_) + data_->header.num_bytes; |
} |
+ uint32_t payload_num_bytes() const { |
+ assert(data_num_bytes_ >= data_->header.num_bytes); |
+ return data_num_bytes_ - data_->header.num_bytes; |
+ } |
// Access the handles. |
const std::vector<Handle>* handles() const { return &handles_; } |