diff --git a/include/v8-isolate.h b/include/v8-isolate.h index e9f531973b..9659300751 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h @@ -233,7 +233,7 @@ class V8_EXPORT Isolate { * Explicitly specify a startup snapshot blob. The embedder owns the blob. * The embedder *must* ensure that the snapshot is from a trusted source. */ - StartupData* snapshot_blob = nullptr; + const StartupData* snapshot_blob = nullptr; /** * Enables the host application to provide a mechanism for recording diff --git a/include/v8-snapshot.h b/include/v8-snapshot.h index 2400357cf6..b15a2b1922 100644 --- a/include/v8-snapshot.h +++ b/include/v8-snapshot.h @@ -91,7 +91,7 @@ class V8_EXPORT SnapshotCreator { */ SnapshotCreator(Isolate* isolate, const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Create and enter an isolate, and set it up for serialization. @@ -102,7 +102,7 @@ class V8_EXPORT SnapshotCreator { * that must be equivalent to CreateParams::external_references. */ SnapshotCreator(const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Destroy the snapshot creator, and exit and dispose of the Isolate diff --git a/src/api/api.cc b/src/api/api.cc index 09217e9730..3b53d5db76 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -546,7 +546,7 @@ struct SnapshotCreatorData { SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, const intptr_t* external_references, - StartupData* existing_snapshot) { + const StartupData* existing_snapshot) { SnapshotCreatorData* data = new SnapshotCreatorData(v8_isolate); i::Isolate* i_isolate = reinterpret_cast(v8_isolate); i_isolate->set_array_buffer_allocator(&data->allocator_); @@ -568,7 +568,7 @@ SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, } SnapshotCreator::SnapshotCreator(const intptr_t* external_references, - StartupData* existing_snapshot) + const StartupData* existing_snapshot) : SnapshotCreator(Isolate::Allocate(), external_references, existing_snapshot) {}