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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/lib/map_data_internal.h

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/map_data_internal.h
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_data_internal.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_data_internal.h
index 7787714fdf029c10ef32a215d4148ce38cb48e42..16f6b08a4740bf70f4ae9b065d189450b340c428 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_data_internal.h
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/map_data_internal.h
@@ -44,10 +44,18 @@ class Map_Data {
if (!data)
return true;
- if (!ValidateStructHeader(data, sizeof(Map_Data), 2, bounds_checker))
+ if (!ValidateStructHeaderAndClaimMemory(data, bounds_checker))
return false;
const Map_Data* object = static_cast<const Map_Data*>(data);
+ // TODO(yzshen): In order to work with other bindings which still interprets
+ // the |version| field as |num_fields|, |version| is set to 2.
+ if (object->header_.num_bytes != sizeof(Map_Data) ||
+ object->header_.version != 2) {
+ ReportValidationError(VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER);
+ return false;
+ }
+
if (!ValidateEncodedPointer(&object->keys.offset)) {
ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
return false;
@@ -106,7 +114,9 @@ class Map_Data {
private:
Map_Data() {
header_.num_bytes = sizeof(*this);
- header_.num_fields = 2;
+ // TODO(yzshen): In order to work with other bindings which still interprets
+ // the |version| field as |num_fields|, set it to version 2 for now.
+ header_.version = 2;
}
~Map_Data() = delete;
};

Powered by Google App Engine
This is Rietveld 408576698