Skip to content

Commit

Permalink
src: split BlobSerializer/BlobDeserializer
Browse files Browse the repository at this point in the history
This patch splits BlobSerializer and BlobDeserializer out of
SnapshotSerializer and SnapshotDeserializer. The child classes
can implement serialization methods for custom types on top
of BlobSerializer/BlobDeserializer for conversions between
native types and binary blobs. This allows us to reuse the
classes for other cases (e.g. SEA blobs).

PR-URL: nodejs#47458
Reviewed-By: Darshan Sen <[email protected]>
  • Loading branch information
joyeecheung authored and yjl9903 committed Apr 28, 2023
1 parent 15afe78 commit 72aad7f
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 100 deletions.
1 change: 1 addition & 0 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ struct SnapshotData {
bool Check() const;
static bool FromFile(SnapshotData* out, FILE* in);
static bool FromBlob(SnapshotData* out, const std::vector<char>& in);
static bool FromBlob(SnapshotData* out, std::string_view in);
static const SnapshotData* FromEmbedderWrapper(
const EmbedderSnapshotData* data);
EmbedderSnapshotData::Pointer AsEmbedderWrapper() const;
Expand Down
Loading

0 comments on commit 72aad7f

Please sign in to comment.