• Ken Rockot's avatar
    Ignore soft message size limits on Serialize calls · 115d41f5
    Ken Rockot authored
    Application code may call mojom structs' generated Serialize() method to
    produce a local array of bytes representing the serialized object. These
    methods ultimately use the same message serialization logic that applies
    to IPC messages.
    
    Soft size limit checks are done during the serialization process, and so
    manual Serialize calls can still trigger crash dumps when serializing
    very large objects.
    
    Since the intent of the checks is to reveal oversized IPC messages for
    performance reasons, there's no reason to apply them on these Serialize
    calls.
    
    This CL modifies the common path used by all generated Serialize()
    methods to ensure that the size checks are bypassed.
    
    Bug: 1141987
    Change-Id: I936ba58cf682c4b63310f746cd19a933c82a70b2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495835Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Commit-Queue: Ken Rockot <rockot@google.com>
    Cr-Commit-Position: refs/heads/master@{#821060}
    115d41f5
serialization.h 5.34 KB