Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions patches/bc343986bd4cb17e49e/chrome-sandbox.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
From 7b959779fb4a9fd6939d03b6fef45bed1c6745b3 Mon Sep 17 00:00:00 2001
From: Sohom <sdatta4@ncsu.edu>
Date: Sun, 15 Feb 2026 01:56:41 -0500
Subject: [PATCH] Add support for Chrome 145

---
.../base/process_launcher/BindService.java | 2 +-
chrome/android/java/AndroidManifest.xml | 4 +-
.../java/gin_java_method_invocation_helper.cc | 2 +
.../gin_java_function_invocation_helper.cc | 43 +++++++++++++++++++
content/renderer/renderer_main.cc | 3 +-
.../modules/remote_objects/remote_object.cc | 1 +
.../renderer/platform/bindings/v8_binding.h | 1 +
7 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/base/android/java/src/org/chromium/base/process_launcher/BindService.java b/base/android/java/src/org/chromium/base/process_launcher/BindService.java
index f0b05f9da4de9..1fb127bf4f3cc 100644
--- a/base/android/java/src/org/chromium/base/process_launcher/BindService.java
+++ b/base/android/java/src/org/chromium/base/process_launcher/BindService.java
@@ -41,7 +41,7 @@ public final class BindService {

static boolean supportVariableConnections() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
- && !BuildConfig.IS_INCREMENTAL_INSTALL;
+ && !true; // VisibleV8 android change required disabling renderer isolation.
}

// Note that handler is not guaranteed to be used, and client still need to correctly handle
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index 030736d46a43d..279cf5a5eb3d8 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -1292,13 +1292,13 @@ by a child template that "extends" this file.
<service android:name="org.chromium.content.app.SandboxedProcessService{{ i }}"
android:process=":sandboxed_process{{ i }}"
android:permission="{{ manifest_package }}.permission.CHILD_SERVICE"
- android:isolatedProcess="true"
+ android:isolatedProcess="false"
android:exported="{{sandboxed_service_exported|default(false)}}"
{% if (i == 0) %}
android:useAppZygote="true"
{% endif %}
{% if (sandboxed_service_exported|default(false)) == 'true' %}
- android:externalService="true"
+ android:externalService="false"
tools:ignore="ExportedService"
android:visibleToInstantApps="true"
{% endif %} />
diff --git a/content/browser/android/java/gin_java_method_invocation_helper.cc b/content/browser/android/java/gin_java_method_invocation_helper.cc
index 2d0c3dd4eb754..5c331d1bd1eb9 100644
--- a/content/browser/android/java/gin_java_method_invocation_helper.cc
+++ b/content/browser/android/java/gin_java_method_invocation_helper.cc
@@ -12,6 +12,8 @@
#include "base/android/event_log.h"
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/logging.h"
+#include "base/debug/stack_trace.h"
#include "content/browser/android/java/gin_java_script_to_java_types_coercion.h"
#include "content/browser/android/java/java_method.h"
#include "content/common/android/gin_java_bridge_value.h"
diff --git a/content/renderer/java/gin_java_function_invocation_helper.cc b/content/renderer/java/gin_java_function_invocation_helper.cc
index 0d126236bc172..94da580147e57 100644
--- a/content/renderer/java/gin_java_function_invocation_helper.cc
+++ b/content/renderer/java/gin_java_function_invocation_helper.cc
@@ -14,6 +14,7 @@
#include "content/renderer/java/gin_java_bridge_object.h"
#include "content/renderer/java/gin_java_bridge_value_converter.h"
#include "v8/include/v8-exception.h"
+#include "v8/include/v8-visiblev8.h"

namespace content {

@@ -79,6 +80,13 @@ v8::Local<v8::Value> GinJavaFunctionInvocationHelper::Invoke(
}
}

+ std::vector<v8::Local<v8::Value>> visv8_args;
+
+ v8::Local<v8::Value> val;
+ while (args->GetNext(&val)) {
+ visv8_args.push_back(val);
+ }
+
mojom::GinJavaBridgeError error =
mojom::GinJavaBridgeError::kGinJavaBridgeNoError;

@@ -95,12 +103,24 @@ v8::Local<v8::Value> GinJavaFunctionInvocationHelper::Invoke(
}
}
if (!result.get()) {
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(
+ args->isolate(), false, functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ v8::Undefined(args->isolate()), visv8_args, visv8_args.size());
args->isolate()->ThrowException(v8::Exception::Error(gin::StringToV8(
args->isolate(), base::StrCat({"Error invoking ", method_name_, ": ",
GinJavaBridgeErrorToString(error)}))));
return v8::Undefined(args->isolate());
}
if (!result->is_blob()) {
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(
+ args->isolate(), false, functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ converter_->ToV8Value(result.get(),
+ args->isolate()->GetCurrentContext()),
+ visv8_args, visv8_args.size());
return converter_->ToV8Value(result.get(),
args->isolate()->GetCurrentContext());
}
@@ -116,15 +136,38 @@ v8::Local<v8::Value> GinJavaFunctionInvocationHelper::Invoke(
if (object_result) {
v8::Local<v8::Value> controller;
if (!object_result->GetWrapper(args->isolate()).ToLocal(&controller)) {
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(
+ args->isolate(), false,
+ functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ v8::Undefined(args->isolate()), visv8_args, visv8_args.size());
return v8::Undefined(args->isolate());
}
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(args->isolate(), false,
+ functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ controller, visv8_args, visv8_args.size());
return controller;
}
} else if (gin_value->IsType(GinJavaBridgeValue::TYPE_NONFINITE)) {
float float_value;
gin_value->GetAsNonFinite(&float_value);
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(args->isolate(), false,
+ functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ v8::Number::New(args->isolate(), float_value),
+ visv8_args, visv8_args.size());
return v8::Number::New(args->isolate(), float_value);
}
+
+ auto* functionCallbackInfo = args->GetFunctionCallbackInfo();
+ v8::visv8_log_java_api_call(
+ args->isolate(), false, functionCallbackInfo->Data().As<v8::String>(),
+ functionCallbackInfo->This().As<v8::Object>(),
+ v8::Undefined(args->isolate()), visv8_args, visv8_args.size());
return v8::Undefined(args->isolate());
}

diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index cc54c30df4042..2c2cfcc91ee24 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -232,8 +232,7 @@ int RendererMain(MainFunctionParams parameters) {
{
content::ContentRendererClient* client = GetContentClient()->renderer();
bool should_run_loop = true;
- bool need_sandbox =
- !command_line.HasSwitch(sandbox::policy::switches::kNoSandbox);
+ bool need_sandbox = false; // VisibleV8 disable sandbox for desktop

if (!need_sandbox) {
// The post-sandbox actions still need to happen at some point.
diff --git a/third_party/blink/renderer/modules/remote_objects/remote_object.cc b/third_party/blink/renderer/modules/remote_objects/remote_object.cc
index c9c72eee69378..98ffd3c5de790 100644
--- a/third_party/blink/renderer/modules/remote_objects/remote_object.cc
+++ b/third_party/blink/renderer/modules/remote_objects/remote_object.cc
@@ -6,6 +6,7 @@

#include <tuple>

+#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "gin/converter.h"
#include "third_party/blink/public/web/blink.h"
diff --git a/third_party/blink/renderer/platform/bindings/v8_binding.h b/third_party/blink/renderer/platform/bindings/v8_binding.h
index 6a0a0762ff359..df13bc22358e2 100644
--- a/third_party/blink/renderer/platform/bindings/v8_binding.h
+++ b/third_party/blink/renderer/platform/bindings/v8_binding.h
@@ -49,6 +49,7 @@
#include "v8/include/v8-maybe.h"
#include "v8/include/v8-persistent-handle.h"
#include "v8/include/v8-primitive.h"
+#include "v8/include/v8-visiblev8.h"
#include "v8/include/v8-value.h"

namespace blink {
--
2.43.0

Loading