[WebView] Add MessagePort(postMessage) support to JavaScript Sandbox. [chromium/src : main]

0 views
Skip to first unread message

Alex Mîrzea (Gerrit)

unread,
Sep 9, 2025, 11:00:41 AMSep 9
to Richard (Torne) Coles, Ashley Newson, chromium...@chromium.org, android-web...@chromium.org
Attention needed from Ashley Newson and Richard (Torne) Coles

Alex Mîrzea added 4 comments

File android_webview/js_sandbox/java/src/org/chromium/android_webview/js_sandbox/service/JsSandboxMessagePort.java
Line 36, Patchset 14: Executor executor = Runnable::run;
Richard (Torne) Coles . resolved

nit: i'd just remove this so it's clearer in the code that it's currently running synchronously.

Alex Mîrzea

Done

File android_webview/js_sandbox/service/js_sandbox_isolate.cc
Line 934, Patchset 14: args->ThrowTypeError("getNamePort requires exactly one argument.");
Richard (Torne) Coles . resolved

nit: spelling

Alex Mîrzea

Done

File android_webview/js_sandbox/service/js_sandbox_message_port.cc
Line 72, Patchset 14:JsSandboxMessagePort::~JsSandboxMessagePort() {
Richard (Torne) Coles . resolved

nit: blank line between things

Alex Mîrzea

Done

Line 195, Patchset 14: std::ranges::copy(
Richard (Torne) Coles . resolved

This is also copying the data twice like the code you already fixed for the other direction, and can be fixed similarly.

Alex Mîrzea

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ashley Newson
  • Richard (Torne) Coles
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I68163115a58d05e56b8184a68b21de9be5fd0560
Gerrit-Change-Number: 6832077
Gerrit-PatchSet: 18
Gerrit-Owner: Alex Mîrzea <alexm...@google.com>
Gerrit-Reviewer: Ashley Newson <ashley...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Attention: Ashley Newson <ashley...@chromium.org>
Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Sep 2025 15:00:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Richard (Torne) Coles <to...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Richard (Torne) Coles (Gerrit)

unread,
Sep 23, 2025, 1:17:58 PM (3 days ago) Sep 23
to Alex Mîrzea, Richard (Torne) Coles, Code Review Nudger, Ashley Newson, chromium...@chromium.org, android-web...@chromium.org
Attention needed from Alex Mîrzea and Ashley Newson

Richard (Torne) Coles voted and added 1 comment

Votes added by Richard (Torne) Coles

Code-Review+1

1 comment

File android_webview/js_sandbox/service/js_sandbox_message_port.cc
Line 89, Patchset 23 (Latest): jsize length = env->GetArrayLength(j_array_buffer.obj());
Richard (Torne) Coles . unresolved

why not just get the length in the function that actually uses the data?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Mîrzea
  • Ashley Newson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I68163115a58d05e56b8184a68b21de9be5fd0560
Gerrit-Change-Number: 6832077
Gerrit-PatchSet: 23
Gerrit-Owner: Alex Mîrzea <alexm...@google.com>
Gerrit-Reviewer: Ashley Newson <ashley...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Alex Mîrzea <alexm...@google.com>
Gerrit-Attention: Ashley Newson <ashley...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 17:17:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Mîrzea (Gerrit)

unread,
Sep 23, 2025, 6:28:49 PM (3 days ago) Sep 23
to Richard (Torne) Coles, Code Review Nudger, Ashley Newson, chromium...@chromium.org, android-web...@chromium.org
Attention needed from Ashley Newson and Richard (Torne) Coles

Alex Mîrzea added 1 comment

File android_webview/js_sandbox/service/js_sandbox_message_port.cc
Line 89, Patchset 23: jsize length = env->GetArrayLength(j_array_buffer.obj());
Richard (Torne) Coles . resolved

why not just get the length in the function that actually uses the data?

Alex Mîrzea

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ashley Newson
  • Richard (Torne) Coles
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I68163115a58d05e56b8184a68b21de9be5fd0560
Gerrit-Change-Number: 6832077
Gerrit-PatchSet: 24
Gerrit-Owner: Alex Mîrzea <alexm...@google.com>
Gerrit-Reviewer: Ashley Newson <ashley...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Attention: Ashley Newson <ashley...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 22:28:35 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Mîrzea (Gerrit)

unread,
Sep 25, 2025, 12:01:35 PM (yesterday) Sep 25
to Richard (Torne) Coles, Code Review Nudger, Ashley Newson, chromium...@chromium.org, android-web...@chromium.org
Attention needed from Ashley Newson and Richard (Torne) Coles

Alex Mîrzea added 1 comment

File android_webview/js_sandbox/java/src/org/chromium/android_webview/js_sandbox/service/JsSandboxMessagePort.java
Line 14, Patchset 9:public class JsSandboxMessagePort {
Ashley Newson . resolved

A TODO, which I'd be happy to postpone to a follow-up CL:

We will need to account for the memory of messages that haven't yet reached the isolate thread. This would probably be done by lifting some of the existing accounting logic out of our arraybuffer allocator class for more general (and thread safe!) usage.

Alex Mîrzea

CL is uploaded.

Open in Gerrit

Related details

Attention is currently required from:
  • Ashley Newson
  • Richard (Torne) Coles
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I68163115a58d05e56b8184a68b21de9be5fd0560
Gerrit-Change-Number: 6832077
Gerrit-PatchSet: 28
Gerrit-Owner: Alex Mîrzea <alexm...@google.com>
Gerrit-Reviewer: Ashley Newson <ashley...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Richard (Torne) Coles <to...@chromium.org>
Gerrit-Attention: Ashley Newson <ashley...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 16:01:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ashley Newson <ashley...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Richard (Torne) Coles (Gerrit)

unread,
3:34 PM (7 hours ago) 3:34 PM
to Alex Mîrzea, Richard (Torne) Coles, Code Review Nudger, Ashley Newson, chromium...@chromium.org, android-web...@chromium.org
Attention needed from Alex Mîrzea and Ashley Newson

Richard (Torne) Coles voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Mîrzea
  • Ashley Newson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I68163115a58d05e56b8184a68b21de9be5fd0560
Gerrit-Change-Number: 6832077
Gerrit-PatchSet: 28
Gerrit-Owner: Alex Mîrzea <alexm...@google.com>
Gerrit-Reviewer: Ashley Newson <ashley...@chromium.org>
Gerrit-Reviewer: Richard (Torne) Coles <to...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Alex Mîrzea <alexm...@google.com>
Gerrit-Attention: Ashley Newson <ashley...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 19:33:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages