[scenic] Add ObjectLinker::Link::ReleaseToken().

The new Flatland API functions for releasing a parent or child link also return
the link token to the caller so that a new link can be established. Right now,
the ObjectLinker consumes these tokens, but as soon as the link is resolved,
the tokens are discarded.

This change:
1. Makes the ObjectLinker hold onto the tokens in the resolved Endpoint rather
   than discarding them on link resolution.
2. Adds a function that allows the link holder to release the token.

When a link releases its token, it is invalidated, which results in the
link_invalidated callback being called if the link was initialized. If the link
was resolved, meaning it has an initialized peer, the peer will be
"unresolved". Unresolving a peer means:
1. The peer's link_invalidated callback will be called, but not erased.
2. The peer will be put back into the "initialized" state, meaning it retains
   its token and callbacks.

Even though the peer receives the link_invalidated callback, it does not need
to be initialized again. For example, if the released token is then used to
create a new link, the peer will receive the link_resolved callback again. This
means that any state set up in the link_resolved callback should be torn down
in the link_invalidated callback.

Fixed: 43745

TEST=fx shell runtests -t gfx_unittests

Change-Id: I3d27702e611402de22c2a99dc68f1fc07e51f374
3 files changed
tree: 35bf948018f82dc5e5638a7ceb6447636e4983da
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. peridot/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .dir-locals.el
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. README.md
  30. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.