summaryrefslogtreecommitdiff
path: root/src/node_main_instance.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-21 20:03:21 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-23 11:26:09 +0800
commitd5d9c349d3f0ff268f8dc2cc31812581bbe2815e (patch)
treed8321a2f2e153f4d236b9fca6f76ab2c1a6bc24d /src/node_main_instance.h
parenteb23b176d8c7122af6add5ee38f87044288d3d39 (diff)
downloadandroid-node-v8-d5d9c349d3f0ff268f8dc2cc31812581bbe2815e.tar.gz
android-node-v8-d5d9c349d3f0ff268f8dc2cc31812581bbe2815e.tar.bz2
android-node-v8-d5d9c349d3f0ff268f8dc2cc31812581bbe2815e.zip
src: use std::vector<size_t> instead of IndexArray
PR-URL: https://github.com/nodejs/node/pull/27321 Refs: https://github.com/nodejs/node/issues/17058 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_main_instance.h')
-rw-r--r--src/node_main_instance.h27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/node_main_instance.h b/src/node_main_instance.h
index 531c919f05..2719b49e97 100644
--- a/src/node_main_instance.h
+++ b/src/node_main_instance.h
@@ -15,18 +15,6 @@ namespace node {
// We may be able to create an abstract class to reuse some of the routines.
class NodeMainInstance {
public:
- // An array of indexes that can be used to deserialize data from a V8
- // snapshot.
- struct IndexArray {
- const size_t* data;
- size_t length;
-
- size_t Get(size_t index) const {
- DCHECK_LT(index, length);
- return data[index];
- }
- };
-
// To create a main instance that does not own the isoalte,
// The caller needs to do:
//
@@ -53,12 +41,13 @@ class NodeMainInstance {
void Dispose();
// Create a main instance that owns the isolate
- NodeMainInstance(v8::Isolate::CreateParams* params,
- uv_loop_t* event_loop,
- MultiIsolatePlatform* platform,
- const std::vector<std::string>& args,
- const std::vector<std::string>& exec_args,
- const IndexArray* per_isolate_data_indexes = nullptr);
+ NodeMainInstance(
+ v8::Isolate::CreateParams* params,
+ uv_loop_t* event_loop,
+ MultiIsolatePlatform* platform,
+ const std::vector<std::string>& args,
+ const std::vector<std::string>& exec_args,
+ const std::vector<size_t>* per_isolate_data_indexes = nullptr);
~NodeMainInstance();
// Start running the Node.js instances, return the exit code when finished.
@@ -72,7 +61,7 @@ class NodeMainInstance {
// If nullptr is returned, the binary is not built with embedded
// snapshot.
- static const IndexArray* GetIsolateDataIndexes();
+ static const std::vector<size_t>* GetIsolateDataIndexes();
static v8::StartupData* GetEmbeddedSnapshotBlob();
static const size_t kNodeContextIndex = 0;