Initialize V8 sandbox in samples
Bug: v8:10391 Change-Id: If54ba6ddaabd14e5f4c232cdc3c29746f89e1cb3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455822 Reviewed-by: Camillo Bruni <cbruni@chromium.org> Commit-Queue: Samuel Groß <saelo@chromium.org> Cr-Commit-Position: refs/heads/main@{#79068}
This commit is contained in:
parent
60245d8397
commit
af78745f2e
@ -20,6 +20,12 @@ int main(int argc, char* argv[]) {
|
||||
v8::V8::InitializeExternalStartupData(argv[0]);
|
||||
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
|
||||
v8::V8::InitializePlatform(platform.get());
|
||||
#ifdef V8_SANDBOX
|
||||
if (!v8::V8::InitializeSandbox()) {
|
||||
fprintf(stderr, "Error initializing the V8 sandbox\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
v8::V8::Initialize();
|
||||
|
||||
// Create a new Isolate and make it the current one.
|
||||
|
@ -703,6 +703,12 @@ int main(int argc, char* argv[]) {
|
||||
v8::V8::InitializeExternalStartupData(argv[0]);
|
||||
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
|
||||
v8::V8::InitializePlatform(platform.get());
|
||||
#ifdef V8_SANDBOX
|
||||
if (!v8::V8::InitializeSandbox()) {
|
||||
fprintf(stderr, "Error initializing the V8 sandbox\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
v8::V8::Initialize();
|
||||
map<string, string> options;
|
||||
string file;
|
||||
|
@ -73,6 +73,12 @@ int main(int argc, char* argv[]) {
|
||||
v8::V8::InitializeExternalStartupData(argv[0]);
|
||||
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
|
||||
v8::V8::InitializePlatform(platform.get());
|
||||
#ifdef V8_SANDBOX
|
||||
if (!v8::V8::InitializeSandbox()) {
|
||||
fprintf(stderr, "Error initializing the V8 sandbox\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
v8::V8::Initialize();
|
||||
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
|
||||
v8::Isolate::CreateParams create_params;
|
||||
|
Loading…
Reference in New Issue
Block a user