Commit 5e07ef10 authored by Samuel Groß's avatar Samuel Groß Committed by V8 LUCI CQ

[sandbox] Remove V8::InitializeSandbox

The function is no longer used in Chromium or V8 and can therefore be
deleted. This CL also simplifies V8::GetSandboxSizeInBytes, which now no
longer needs to be able to deal with an uninitialized sandbox.

Bug: v8:10391
Change-Id: I22d6b0e03de1fd2ba3d38c4e476fca44068b62f9
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3769690Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82583}
parent 543ba554
......@@ -186,23 +186,6 @@ class V8_EXPORT V8 {
static void DisposePlatform();
#if defined(V8_ENABLE_SANDBOX)
/**
* Initializes the V8 sandbox.
*
* This must be invoked after the platform was initialized but before V8 is
* initialized. The sandbox is torn down during platform shutdown.
* Returns true on success, false otherwise.
*
* TODO(saelo) Once it is no longer optional to initialize the sandbox when
* compiling with V8_ENABLE_SANDBOX, the sandbox initialization will likely
* happen as part of V8::Initialize, at which point this function should be
* removed.
*/
V8_DEPRECATE_SOON(
"Sandbox initialization now happens during V8::Initialize. Calling this "
"function is no longer necessary.")
static bool InitializeSandbox();
/**
* Returns true if the sandbox is configured securely.
*
......@@ -226,8 +209,6 @@ class V8_EXPORT V8 {
* and so in particular the contents of pages allocagted in this virtual
* address space, arbitrarily and concurrently. Due to this, it is
* recommended to to only place pure data buffers in them.
*
* This function must only be called after initializing the sandbox.
*/
static VirtualAddressSpace* GetSandboxAddressSpace();
......@@ -236,9 +217,6 @@ class V8_EXPORT V8 {
*
* This represents the size of the address space that V8 can directly address
* and in which it allocates its objects.
*
* If the sandbox has not been initialized, or if the initialization failed,
* this returns zero.
*/
static size_t GetSandboxSizeInBytes();
......
......@@ -6062,12 +6062,6 @@ void v8::V8::InitializePlatform(Platform* platform) {
i::V8::InitializePlatform(platform);
}
#ifdef V8_ENABLE_SANDBOX
// Sandbox initialization now happens during V8::Initialize.
// TODO(saelo) remove this function once Embedders no longer use it.
bool v8::V8::InitializeSandbox() { return true; }
#endif // V8_ENABLE_SANDBOX
void v8::V8::DisposePlatform() { i::V8::DisposePlatform(); }
bool v8::V8::Initialize(const int build_config) {
......@@ -6240,11 +6234,10 @@ VirtualAddressSpace* v8::V8::GetSandboxAddressSpace() {
}
size_t v8::V8::GetSandboxSizeInBytes() {
if (!i::GetProcessWideSandbox()->is_initialized()) {
return 0;
} else {
return i::GetProcessWideSandbox()->size();
}
Utils::ApiCheck(i::GetProcessWideSandbox()->is_initialized(),
"v8::V8::GetSandboxSizeInBytes",
"The sandbox must be initialized first.");
return i::GetProcessWideSandbox()->size();
}
size_t v8::V8::GetSandboxReservationSizeInBytes() {
......
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