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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 10 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: third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc
index 936d0ca864ab37c27ccd5c640cbf3e6ccd08b0ea..6332090fd9b38e7979cb7bf6ead78d46714892dc 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_serialization.cc
@@ -79,12 +79,8 @@ void DecodeHandle(Handle* handle, std::vector<Handle>* handles) {
*handle = FetchAndReset(&handles->at(handle->value()));
}
-bool ValidateStructHeader(const void* data,
- uint32_t min_num_bytes,
- uint32_t min_num_fields,
- BoundsChecker* bounds_checker) {
- MOJO_DCHECK(min_num_bytes >= sizeof(StructHeader));
-
+bool ValidateStructHeaderAndClaimMemory(const void* data,
+ BoundsChecker* bounds_checker) {
if (!IsAligned(data)) {
ReportValidationError(VALIDATION_ERROR_MISALIGNED_OBJECT);
return false;
@@ -96,11 +92,7 @@ bool ValidateStructHeader(const void* data,
const StructHeader* header = static_cast<const StructHeader*>(data);
- // TODO(yzshen): Currently our binding code cannot handle structs of smaller
- // size or with fewer fields than the version that it sees. That needs to be
- // changed in order to provide backward compatibility.
- if (header->num_bytes < min_num_bytes ||
- header->num_fields < min_num_fields) {
+ if (header->num_bytes < sizeof(StructHeader)) {
ReportValidationError(VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER);
return false;
}

Powered by Google App Engine
This is Rietveld 408576698