mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 17:38:10 +00:00
Lazily load nodes
Node registry now only tracks the node id (which we need to be consistent) and the underlying parser.Node. All other data is loaded on-demand (i.e. when we serialize the node). This allows us to serialize node values as they appear when they are serialized, as opposed to when they are registered.
This commit is contained in:
@@ -325,6 +325,14 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
||||
self.node_search_list.reset();
|
||||
}
|
||||
|
||||
pub fn nodeWriter(self: *Self, node: *const Node, opts: Node.Writer.Opts) Node.Writer {
|
||||
return .{
|
||||
.node = node,
|
||||
.opts = opts,
|
||||
.registry = &self.node_registry,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn onInspectorResponse(ctx: *anyopaque, _: u32, msg: []const u8) void {
|
||||
if (std.log.defaultLogEnabled(.debug)) {
|
||||
// msg should be {"id":<id>,...
|
||||
|
||||
Reference in New Issue
Block a user