Commit 099da60e authored by danakj's avatar danakj Committed by Chromium LUCI CQ

Use skia.mojom.BitmapN32 in TransferableMessage mojoms

These bitmaps are safer for transport from untrustworthy sources since
all bitmaps should be in N32 format and the browser can make bad
assumptions as a result.

R=dcheng@chromium.org

Bug: 1144462
Change-Id: Ib72a5200cce720dc42af6388d0137f5b7b1d5bb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2572701Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833974}
parent ca14725f
......@@ -26,7 +26,7 @@ import org.chromium.mojo.bindings.MessageReceiver;
import org.chromium.mojo.system.Core;
import org.chromium.mojo.system.Pair;
import org.chromium.mojo_base.BigBufferUtil;
import org.chromium.skia.mojom.BitmapWithArbitraryBpp;
import org.chromium.skia.mojom.BitmapN32;
/**
* Represents the MessageChannel MessagePort object. Inspired from
......@@ -299,7 +299,7 @@ public class AppWebMessagePort implements MessagePort {
msg.message.nativeFileSystemTokens = new NativeFileSystemTransferToken[0];
msg.message.senderOrigin = null;
msg.arrayBufferContentsArray = new SerializedArrayBufferContents[0];
msg.imageBitmapContentsArray = new BitmapWithArbitraryBpp[0];
msg.imageBitmapContentsArray = new BitmapN32[0];
msg.ports = ports;
msg.streamChannels = new MessagePortDescriptor[0];
mConnector.accept(msg.serializeWithHeader(mMojoCore, MESSAGE_HEADER));
......
......@@ -30,7 +30,7 @@ struct TransferableMessage {
// Any ArrayBuffers being transferred as part of this message.
array<SerializedArrayBufferContents> array_buffer_contents_array;
// Any ImageBitmaps being transferred as part of this message.
array<skia.mojom.BitmapWithArbitraryBpp> image_bitmap_contents_array;
array<skia.mojom.BitmapN32> image_bitmap_contents_array;
// The user activation state, null if the frame isn't providing it.
UserActivationSnapshot? user_activation;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment