Skip to content
Snippets Groups Projects
  1. Feb 01, 2023
  2. Jan 31, 2023
  3. Jan 27, 2023
  4. Jan 24, 2023
  5. Jan 23, 2023
  6. Jan 20, 2023
  7. Jan 19, 2023
  8. Jan 18, 2023
  9. Jan 17, 2023
  10. Jan 10, 2023
  11. Jan 04, 2023
  12. Jan 03, 2023
    • Ben Dean-Kawamura's avatar
      Bug 1788306: UniFFI callback interfaces, r=nika · 79c4dcd5
      Ben Dean-Kawamura authored
      Started callback interface functionality to UniFFI.  Currently this only
      supports the async fire-and-forget use case, where Rust queues a JS
      function to run, but doesn't wait (or `await`) for the response.
      
      The basic system is:
      
        - The JS code registers a callback interface handler with the C++
          code.  This handler is responsible for the specifics of invoking the
          callback.
        - The C++ code defines a function to call a JS handler.  Once the JS
          handler registers itself with C++, the C++ registers it's function
          with Rust.
        - The C++ code queues the call to the JS main thread.
        - Because of how UniFFI handles callback interfaces, the C++ code can
          be "dumb".  UniFFI sends a object id, method id, and RustBuffer
          encoding all arguments.  This means C++ doesn't need to care about
          the specific arguments, they get unpacked by JS.
      
      I tried to keep the generated code as simple as possible by moving the
      complexity to static code.  For JS this meant writing a generic
      `UniFFICallbackHandler` class in the static code that the generated code
      constructs.  For C++ this meant the generated code defines a
      `UniFFIGetCallbackInterfaceInfo` function that returns a struct with all
      the data specific to a callback interface (it's name, the UniFFI
      scaffolding init function, etc).  The static code can then define a
      generic `QueueCallback` function that looks up the callback interface
      info using the interface ID and then makes the call.
      
      Allow UniFFI functions to run on the main thread rather than always
      being dispatched to a worker thread.  This allows us to test invoking
      callback interfaces from the main thread thread. I don't think we will
      use this much currently, since we don't want to block the main thread
      for any significant amount of time. However, this will pair well with
      the next step in the project which is async -- allowing async Rust
      functions to call async JS functions. In that scenario, dispatching to
      the worker thread is unnecessary.
      
      Callback interface objects present a potential memory leak, since you
      can easily create a cycle between a JS Callback object and a UniFFIed
      Rust object, and the GC has no way of detecting it.  To try to detect
      these there's some shutdown code that checks that there are no callbacks
      registered during shutdown and prevents any future callbacks from being
      registered.
      
      Added a `config.toml` file and code to parse it.  This is needed to
      specify which functions should run on the main thread.
      
      Updated the git commits for the several UniFFI examples/fixtures.
      
      Differential Revision: https://phabricator.services.mozilla.com/D156116
      79c4dcd5
  13. Dec 23, 2022
  14. Dec 21, 2022
  15. Dec 20, 2022
  16. Dec 17, 2022
    • Jim Blandy's avatar
      Bug 1806166: Update wgpu to f14bee67 (2022-12-16) r=nical,supply-chain-reviewers · dde6692f
      Jim Blandy authored
      This brings in various bugfixes and improvements from upstream,
      including the fix for bug 1791809 and a workaround for bug 1804530.
      
      In this update, `wgpu_core` leaves the selection of backends to its
      users, rather than trying to guess which backends to use itself, based
      on the target architecture and operating system. For Firefox, this
      means that `gfx/wgpu_bindings/Cargo.toml` is now responsible for
      selecting back ends.
      
      Firefox's WebGPU implementation should never use `wgpu`'s GLES
      backend. Firefox can now explain this to `wgpu-core`, causing it to
      drop its dependency on `glow`, `bitflags_serde_shim` and `slotmap`.
      These are no longer vendored, and their exemptions in
      `supply-chain/config.toml` can be dropped.
      
      The new `wgpu-core` updates to version 0.37.1+1.3.235 of the `ash`
      crate, and this patch moves ash's supply-chain exemption forward to
      the new version. We expect to finish vetting that next week, but
      because this `wgpu-core` update is urgently needed, we want to extend
      the exemption for the time being.
      
      The dependency on `slotmap` had been patched to an empty file in
      `build/rust/dummy-web`, which can now be removed.
      
      The new `wgpu-core` no longer uses `cfg_aliases`, so Firefox no longer
      needs to vendor that.
      
      Differential Revision: https://phabricator.services.mozilla.com/D164928
      dde6692f
  17. Dec 15, 2022
  18. Dec 14, 2022
    • Csoregi Natalia's avatar
      Backed out changeset e6becf16d643 (bug 1788306) for causing bustage on... · ffeed88c
      Csoregi Natalia authored
      Backed out changeset e6becf16d643 (bug 1788306) for causing bustage on UniFFICallbacks.cpp. CLOSED TREE
      ffeed88c
    • Ben Dean-Kawamura's avatar
      Bug 1788306: UniFFI callback interfaces, r=nika · 22d5d422
      Ben Dean-Kawamura authored
      Started callback interface functionality to UniFFI.  Currently this only
      supports the async fire-and-forget use case, where Rust queues a JS
      function to run, but doesn't wait (or `await`) for the response.
      
      The basic system is:
      
        - The JS code registers a callback interface handler with the C++
          code.  This handler is responsible for the specifics of invoking the
          callback.
        - The C++ code defines a function to call a JS handler.  Once the JS
          handler registers itself with C++, the C++ registers it's function
          with Rust.
        - The C++ code queues the call to the JS main thread.
        - Because of how UniFFI handles callback interfaces, the C++ code can
          be "dumb".  UniFFI sends a object id, method id, and RustBuffer
          encoding all arguments.  This means C++ doesn't need to care about
          the specific arguments, they get unpacked by JS.
      
      I tried to keep the generated code as simple as possible by moving the
      complexity to static code.  For JS this meant writing a generic
      `UniFFICallbackHandler` class in the static code that the generated code
      constructs.  For C++ this meant the generated code defines a
      `UniFFIGetCallbackInterfaceInfo` function that returns a struct with all
      the data specific to a callback interface (it's name, the UniFFI
      scaffolding init function, etc).  The static code can then define a
      generic `QueueCallback` function that looks up the callback interface
      info using the interface ID and then makes the call.
      
      Allow UniFFI functions to run on the main thread rather than always
      being dispatched to a worker thread.  This allows us to test invoking
      callback interfaces from the main thread thread. I don't think we will
      use this much currently, since we don't want to block the main thread
      for any significant amount of time. However, this will pair well with
      the next step in the project which is async -- allowing async Rust
      functions to call async JS functions. In that scenario, dispatching to
      the worker thread is unnecessary.
      
      Callback interface objects present a potential memory leak, since you
      can easily create a cycle between a JS Callback object and a UniFFIed
      Rust object, and the GC has no way of detecting it.  To try to detect
      these there's some shutdown code that checks that there are no callbacks
      registered during shutdown and prevents any future callbacks from being
      registered.
      
      Added a `config.toml` file and code to parse it.  This is needed to
      specify which functions should run on the main thread.
      
      Updated the git commits for the several UniFFI examples/fixtures.
      
      Differential Revision: https://phabricator.services.mozilla.com/D156116
      22d5d422
  19. Dec 13, 2022
  20. Dec 08, 2022
  21. Dec 07, 2022
Loading