class Node
Defined at line 45 of file ../../src/sysmem/server/node.h
Implemented by BufferCollectionToken, BufferCollectionTokenGroup, BufferCollection, and
OrphanedNode.
Things that can change when transmuting from BufferCollectionToken to BufferCollection, from
BufferCollectionToken to OrphanedNode, or from BufferCollection to OrphanedNode, should generally
go in Node. Things that don't change when transmuting go in NodeProperties.
Protected Members
bool is_done_
optional async_failure_result_
function_impl error_handler_
Node inspect_node_
NumericProperty debug_id_property_
Property debug_name_property_
ValueList properties_
Public Methods
void Node (fbl::RefPtr<LogicalBufferCollection> logical_buffer_collection, NodeProperties * node_properties, zx::unowned_channel server_end)
Defined at line 20 of file ../../src/sysmem/server/node.cc
zx_status_t create_status ()
Construction status.
Defined at line 41 of file ../../src/sysmem/server/node.cc
void Node (const Node & to_copy)
Defined at line 47 of file ../../src/sysmem/server/node.h
void ~Node ()
Defined at line 47 of file ../../src/sysmem/server/node.cc
void Node (Node && to_move)
Defined at line 48 of file ../../src/sysmem/server/node.h
void Bind (NodeServerEnd server_end)
Defined at line 52 of file ../../src/sysmem/server/node.cc
void SetErrorHandler (fit::function<void (zx_status_t)> error_handler)
Defined at line 88 of file ../../src/sysmem/server/node.cc
void Fail (fuchsia_sysmem2::Error error)
The Node must have 0 children to call Fail(). The maybe_error is translated to an epitaph for
sysmem(1), and ignored for sysmem2 (epitaph always ZX_ERR_INTERNAL). In both cases the channel
is closed.
Defined at line 95 of file ../../src/sysmem/server/node.cc
bool ReadyForAllocation ()
Not all Node(s) that are ReadyForAllocation() have buffer_collection_constraints(). In
particular an OrphanedNode is always ReadyForAllocation(), but may or may not have
buffer_collection_constraints().
void OnBuffersAllocated (const AllocationResult & allocation_result)
buffers_logically_allocated() must be false to call this.
BufferCollectionToken * buffer_collection_token ()
Consider whether to use the sub-class accessors below, or whether to use
NodeProperties::is_token(), is_token_group(), is_collection() instead, depending on the
situation. A client Release() + channel close will replace the sub-class of Node with an
OrphanedNode, yet the NodeProperties still needs to be treated as a token, collection, or
group when it comes to the logical node tree and allocation. These accessors are for getting a
pointer to the current Node sub-class, not for checking the logical node type. These can also
be used to determine if the current Node sub-class indicates that the client still has a
connection open to this logical node.
If this Node is a BufferCollectionToken, returns the BufferCollectionToken*, else returns
nullptr.
const BufferCollectionToken * buffer_collection_token ()
BufferCollection * buffer_collection ()
If this Node is a BufferCollection, returns the BufferCollection*, else returns nullptr.
const BufferCollection * buffer_collection ()
OrphanedNode * orphaned_node ()
If this Node is an OrphanedNode, returns the OrphanedNode*, else returns nullptr.
const OrphanedNode * orphaned_node ()
BufferCollectionTokenGroup * buffer_collection_token_group ()
If this Node is a BufferCollectionTokenGroup, returns the BufferCollectionTokenGroup*, else
returns nullptr.
const BufferCollectionTokenGroup * buffer_collection_token_group ()
bool is_connected_type ()
This is a constant per sub-class of Node. When a "connected" node is no longer connected, the
Node sub-class is replaced with OrphanedNode, or deleted as appropriate.
bool is_currently_connected ()
This is dynamic depending on whether the Node sub-class server-side binding is currently bound
or in other words whether the node is currently connected. This will always return false
when !is_connected_type(), and can return true or false if is_connected_type().
const char * node_type_string ()
ConnectionVersion connection_version ()
LogicalBufferCollection & logical_buffer_collection ()
Defined at line 121 of file ../../src/sysmem/server/node.cc
fbl::RefPtr<LogicalBufferCollection> shared_logical_buffer_collection ()
Defined at line 125 of file ../../src/sysmem/server/node.cc
void set_unfound_node ()
Defined at line 127 of file ../../src/sysmem/server/node.h
bool was_unfound_node ()
Defined at line 128 of file ../../src/sysmem/server/node.h
NodeProperties & node_properties ()
If the NodeProperties this Node started with is gone, this asserts, including in release. A
hard crash is better than going off in the weeds.
Defined at line 129 of file ../../src/sysmem/server/node.cc
zx::unowned_channel channel ()
Returns server end of the channel serving this node. At least for now, this must only be
called when it's known that the binding is still valid. We check this using
is_currently_connected().
Defined at line 134 of file ../../src/sysmem/server/node.cc
bool is_done ()
Defined at line 139 of file ../../src/sysmem/server/node.cc
bool has_client_koid ()
Defined at line 144 of file ../../src/sysmem/server/node.cc
zx_koid_t client_koid ()
Defined at line 148 of file ../../src/sysmem/server/node.cc
bool has_server_koid ()
Defined at line 153 of file ../../src/sysmem/server/node.cc
zx_koid_t server_koid ()
Defined at line 157 of file ../../src/sysmem/server/node.cc
void SetDebugClientInfoInternal (ClientDebugInfo debug_info)
Defined at line 97 of file ../../src/sysmem/server/node.cc
Sysmem * parent_sysmem ()
Defined at line 162 of file ../../src/sysmem/server/node.cc
Protected Methods
void BindInternalV1 (zx::channel server_end, ErrorHandlerWrapper error_handler_wrapper)
void BindInternalV2 (zx::channel server_end, ErrorHandlerWrapper error_handler_wrapper)
void BindInternalCombinedV1AndV2 (zx::channel server_end, ErrorHandlerWrapper error_handler_wrapper)
void CloseServerBinding (zx_status_t epitaph)
template <typename Completer>
void FailSync (Location location, ConnectionVersion version, Completer & completer, zx_status_t status, const char * format)
Defined at line 145 of file ../../src/sysmem/server/node.h
template <class SyncCompleterSync>
void SyncImpl (ConnectionVersion version, SyncCompleterSync & completer)
Defined at line 161 of file ../../src/sysmem/server/node.h
void CloseChannel (fuchsia_sysmem2::Error error)
Defined at line 164 of file ../../src/sysmem/server/node.cc
template <class ReleaseCompleterSync>
void ReleaseImpl (ConnectionVersion version, ReleaseCompleterSync & completer)
Defined at line 175 of file ../../src/sysmem/server/node.h
template <class SetNameRequestView, class SetNameCompleterSync>
void SetNameImplV1 (SetNameRequestView request, SetNameCompleterSync & completer)
Defined at line 189 of file ../../src/sysmem/server/node.h
template <class SetNameRequest, class SetNameCompleterSync>
void SetNameImplV2 (SetNameRequest & request, SetNameCompleterSync & completer)
Defined at line 200 of file ../../src/sysmem/server/node.h
template <class SetDebugClientInfoRequestView, class SetDebugClientInfoCompleterSync>
void SetDebugClientInfoImplV1 (SetDebugClientInfoRequestView request, SetDebugClientInfoCompleterSync & completer)
Defined at line 222 of file ../../src/sysmem/server/node.h
template <class SetDebugClientInfoRequest, class SetDebugClientInfoCompleterSync>
void SetDebugClientInfoImplV2 (SetDebugClientInfoRequest & request, SetDebugClientInfoCompleterSync & completer)
Defined at line 238 of file ../../src/sysmem/server/node.h
template <class SetDebugTimeoutLogDeadlineRequestView, class SetDebugTimeoutLogDeadlineCompleterSync>
void SetDebugTimeoutLogDeadlineImplV1 (SetDebugTimeoutLogDeadlineRequestView request, SetDebugTimeoutLogDeadlineCompleterSync & completer)
Defined at line 265 of file ../../src/sysmem/server/node.h
template <class SetDebugTimeoutLogDeadlineRequest, class SetDebugTimeoutLogDeadlineCompleterSync>
void SetDebugTimeoutLogDeadlineImplV2 (SetDebugTimeoutLogDeadlineRequest & request, SetDebugTimeoutLogDeadlineCompleterSync & completer)
Defined at line 276 of file ../../src/sysmem/server/node.h
template <class SetVerboseLoggingCompleterSync>
void SetVerboseLoggingImpl (ConnectionVersion version, SetVerboseLoggingCompleterSync & completer)
Defined at line 292 of file ../../src/sysmem/server/node.h
template <typename GetNodeRefCompleterSync>
bool CommonGetNodeRefImplStage1 (ConnectionVersion version, GetNodeRefCompleterSync & completer, zx::event * out_to_vend)
Defined at line 302 of file ../../src/sysmem/server/node.h
template <class GetNodeRefCompleterSync>
void GetNodeRefImplV1 (GetNodeRefCompleterSync & completer)
Defined at line 321 of file ../../src/sysmem/server/node.h
template <class GetNodeRefCompleterSync, class Response = fuchsia_sysmem2::NodeGetNodeRefResponse>
void GetNodeRefImplV2 (GetNodeRefCompleterSync & completer)
Defined at line 330 of file ../../src/sysmem/server/node.h
template <typename Completer>
bool CommonIsAlternateFor (zx::event node_ref, ConnectionVersion version, Completer & completer, bool * out_result)
Defined at line 341 of file ../../src/sysmem/server/node.h
template <class IsAlternateForRequest, class IsAlternateForCompleterSync, class Response = fuchsia_sysmem::NodeIsAlternateForResponse>
void IsAlternateForImplV1 (IsAlternateForRequest & request, IsAlternateForCompleterSync & completer)
Defined at line 392 of file ../../src/sysmem/server/node.h
template <class IsAlternateForRequest, class IsAlternateForCompleterSync, class Response = fuchsia_sysmem2::NodeIsAlternateForResponse>
void IsAlternateForImplV2 (IsAlternateForRequest & request, IsAlternateForCompleterSync & completer)
Defined at line 406 of file ../../src/sysmem/server/node.h
template <class GetBufferCollectionIdCompleterSync, class Response = fuchsia_sysmem2::NodeGetBufferCollectionIdResponse>
void GetBufferCollectionIdImplV2 (GetBufferCollectionIdCompleterSync & completer)
Defined at line 425 of file ../../src/sysmem/server/node.h
template <class SetWeakCompleterSync>
void SetWeakImplV2 (SetWeakCompleterSync & completer)
Defined at line 437 of file ../../src/sysmem/server/node.h
template <class AttachNodeTrackingRequest, class AttachNodeTrackingCompleterSync>
void AttachNodeTrackingImpl (AttachNodeTrackingRequest & request, AttachNodeTrackingCompleterSync & completer)
Defined at line 455 of file ../../src/sysmem/server/node.h
template <class SetWeakOkRequest, class SetWeakOkCompleterSync>
void SetWeakOkImplV2 (SetWeakOkRequest & request, SetWeakOkCompleterSync & completer)
Defined at line 476 of file ../../src/sysmem/server/node.h