@@ -1280,11 +1280,11 @@ SnapshotableObject::SnapshotableObject(Environment* env,
1280
1280
: BaseObject(env, wrap), type_(type) {
1281
1281
}
1282
1282
1283
- const char * SnapshotableObject::GetTypeNameChars () const {
1283
+ std::string_view SnapshotableObject::GetTypeName () const {
1284
1284
switch (type_) {
1285
1285
#define V (PropertyName, NativeTypeName ) \
1286
1286
case EmbedderObjectType::k_##PropertyName: { \
1287
- return NativeTypeName::type_name.c_str (); \
1287
+ return NativeTypeName::type_name.as_string_view (); \
1288
1288
}
1289
1289
SERIALIZABLE_OBJECT_TYPES (V)
1290
1290
#undef V
@@ -1325,7 +1325,7 @@ void DeserializeNodeInternalFields(Local<Object> holder,
1325
1325
per_process::Debug (DebugCategory::MKSNAPSHOT, \
1326
1326
" Object %p is %s\n " , \
1327
1327
(*holder), \
1328
- NativeTypeName::type_name.c_str ()); \
1328
+ NativeTypeName::type_name.as_string_view ()); \
1329
1329
env_ptr->EnqueueDeserializeRequest ( \
1330
1330
NativeTypeName::Deserialize, \
1331
1331
holder, \
@@ -1387,7 +1387,7 @@ StartupData SerializeNodeContextInternalFields(Local<Object> holder,
1387
1387
per_process::Debug (DebugCategory::MKSNAPSHOT,
1388
1388
" Object %p is %s, " ,
1389
1389
*holder,
1390
- obj->GetTypeNameChars ());
1390
+ obj->GetTypeName ());
1391
1391
InternalFieldInfoBase* info = obj->Serialize (index);
1392
1392
1393
1393
per_process::Debug (DebugCategory::MKSNAPSHOT,
@@ -1412,7 +1412,7 @@ void SerializeSnapshotableObjects(Realm* realm,
1412
1412
}
1413
1413
SnapshotableObject* ptr = static_cast <SnapshotableObject*>(obj);
1414
1414
1415
- const char * type_name = ptr->GetTypeNameChars () ;
1415
+ std::string type_name{ ptr->GetTypeName ()} ;
1416
1416
per_process::Debug (DebugCategory::MKSNAPSHOT,
1417
1417
" Serialize snapshotable object %i (%p), "
1418
1418
" object=%p, type=%s\n " ,
0 commit comments