Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing FileHandle objects via postMessage #33772

Closed
wants to merge 11 commits into from

Commits on Jun 11, 2020

  1. Configuration menu
    Copy the full SHA
    cbc35c3 View commit details
    Browse the repository at this point in the history
  2. worker: allow transferring/cloning generic BaseObjects

    Extend support for transferring objects à la `MessagePort` to other
    types of `BaseObject` subclasses, as well as implement cloning
    support for cases in which destructive transferring is not needed
    or optional.
    addaleax committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    915b90e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5f25ff9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1aad92 View commit details
    Browse the repository at this point in the history
  5. worker: allow passing JS wrapper objects via postMessage

    Enable JS wrapper objects to be used as transferable or cloneable
    objects in `postMessage()` calls, by having them extend a C++-backed
    class.
    
    This requires a few internal changes:
    - This commit adds the possibility for transferred objects to
      read/write JS values at the end of the serialization/deserialization
      phases.
    - This commit adds the possibility for transferred objects to list
      sub-transferables, e.g. typically the public JS wrapper class
      would list its C++ handle in there.
    - This commit adds usage of `BaseObject` in a few more places, because
      now during deserialization weakly held objects can also be involved,
      in addition to `MessagePort`s.
    addaleax committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    877d631 View commit details
    Browse the repository at this point in the history
  6. worker,fs: make FileHandle transferable

    Allow passing `FileHandle` instances in the transfer list
    of a `.postMessage()` call.
    addaleax committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    758fe1a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    82a2220 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    22e70e2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c74eeb2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a94759a View commit details
    Browse the repository at this point in the history
  11. worker: emit 'messagerror' events for failed deserialization

    This is much nicer than just treating exceptions as uncaught, and
    enables reporting of exceptions from the internal C++ deserialization
    machinery.
    addaleax committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    9f487ab View commit details
    Browse the repository at this point in the history