Mojo: Align string sizes when serializing a native type.

When determining the serialized size of a string field of a Mojo struct
with a typemapped type, that size is not aligned. When serializing that
string, each allocation in the buffer is aligned to 8 bytes. This can
result in the buffer requiring a re-allocation to accommodate the actual
serialized size and failed DCHECKs. This CL fixes this by aligning each
string size.

Review URL: https://codereview.chromium.org/1867483002

Cr-Commit-Position: refs/heads/master@{#385589}


CrOS-Libchrome-Original-Commit: 1953e4dd01ffe90142c2b0ff810c661f4bdbc1f6
6 files changed
tree: 219872196378c819ecf2fdb6265ce3ed41648911
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/