GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: make BaseObject::is_snapshotable virtual · nodejs/node@33436e3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • base_object.h
    • node_snapshotable.cc
    • node_snapshotable.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/base_object.h‎

Copy file name to clipboardExpand all lines: src/base_object.h
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ class BaseObject : public MemoryRetainer {
158158

159159
virtual inline void OnGCCollect();
160160

161-
bool is_snapshotable() const { return is_snapshotable_; }
162-
void set_is_snapshotable(bool val) { is_snapshotable_ = val; }
161+
virtual inline bool is_snapshotable() const { return false; }
163162

164163
private:
165164
v8::Local<v8::Object> WrappedObject() const override;
@@ -209,7 +208,6 @@ class BaseObject : public MemoryRetainer {
209208

210209
Environment* env_;
211210
PointerData* pointer_data_ = nullptr;
212-
bool is_snapshotable_ = false;
213211
};
214212

215213
// Global alias for FromJSObject() to avoid churn.
Collapse file

‎src/node_snapshotable.cc‎

Copy file name to clipboardExpand all lines: src/node_snapshotable.cc
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ SnapshotableObject::SnapshotableObject(Environment* env,
1616
Local<Object> wrap,
1717
EmbedderObjectType type)
1818
: BaseObject(env, wrap), type_(type) {
19-
set_is_snapshotable(true);
2019
}
2120

2221
const char* SnapshotableObject::GetTypeNameChars() const {
Collapse file

‎src/node_snapshotable.h‎

Copy file name to clipboardExpand all lines: src/node_snapshotable.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class SnapshotableObject : public BaseObject {
9090
virtual void PrepareForSerialization(v8::Local<v8::Context> context,
9191
v8::SnapshotCreator* creator) = 0;
9292
virtual InternalFieldInfo* Serialize(int index) = 0;
93+
bool is_snapshotable() const override { return true; }
9394
// We'll make sure that the type is set in the constructor
9495
EmbedderObjectType type() { return type_; }
9596

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.