class PlaybackImpl

Defined at line 19 of file ../../src/sensors/playback/playback_impl.h

Public Methods

void PlaybackImpl (async_dispatcher_t * dispatcher, PlaybackController & controller)

Defined at line 20 of file ../../src/sensors/playback/playback_impl.cc

void ConfigurePlayback (ConfigurePlaybackRequest & request, ConfigurePlaybackCompleter::Sync & completer)

Defined at line 23 of file ../../src/sensors/playback/playback_impl.cc

void handle_unknown_method (fidl::UnknownMethodMetadata<Playback> metadata, fidl::UnknownMethodCompleter::Sync & completer)

Defined at line 39 of file ../../src/sensors/playback/playback_impl.cc

void OnUnbound (fidl::UnbindInfo info, fidl::ServerEnd<Playback> server_end, fit::callback<void ()> unbind_callback)

Defined at line 45 of file ../../src/sensors/playback/playback_impl.cc

void BindSelfManagedServer (async_dispatcher_t * dispatcher, async::Executor & cleanup_executor, PlaybackController & controller, fidl::ServerEnd<Playback> server_end)

Server connection management.

LIFECYCLE NOTES:

Cleaning up when a Driver protocol client disconnects involves waiting for some cleanup to

happen on the playback controller thread. In order to do this, the version of BindServer which

accepts a shared_ptr is used so that the DriverImpl instance can be kept alive after the

OnUnbound callback returns.

A copy of the shared_ptr is stored in a callback which is given to the controller when it is

notified of the client's disconnection. When the controller cleanup is done, it will call the

callback which in turn schedules a promise that resets the shared_ptr (deleting the DriverImpl

instance). It's not legal for the DriverImpl to delete itself in a task scheduled on it's own

Executor. Instead, a separate Executor which schedules on the same thread but outlives the

DriverImpl instance is provided for the final part of the cleanup.

Defined at line 49 of file ../../src/sensors/playback/playback_impl.h