GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [v14.x] Allow passing FileHandle objects via postMessage by addaleax · Pull Request #33965 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Jun 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Backport of #33772 (only one minor conflict, between the first commit and #33600)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji codebytere reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction
addaleax added 6 commits June 19, 2020 16:15
@addaleax
src: introduce BaseObject base FunctionTemplate
899aa5c
PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
worker: allow transferring/cloning generic BaseObjects
3f52842
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.

PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
src: add equality operators for BaseObjectPtr
36ce8b0
PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
worker: allow passing JS wrapper objects via postMessage
3a6265d
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.

PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
worker,fs: make FileHandle transferable
9e99e13
Allow passing `FileHandle` instances in the transfer list
of a `.postMessage()` call.

PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
worker: emit 'messagerror' events for failed deserialization
dc14e02
This is much nicer than just treating exceptions as uncaught, and
enables reporting of exceptions from the internal C++ deserialization
machinery.

PR-URL: nodejs#33772
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. v14.x labels Jun 19, 2020
@nodejs-github-bot

nodejs-github-bot commented Jun 19, 2020 •
edited by addaleax
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/31949/ (💚)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

codebytere
codebytere approved these changes Jun 22, 2020
View reviewed changes
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
src: introduce BaseObject base FunctionTemplate
0720d1f
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
worker: allow transferring/cloning generic BaseObjects
eaccf84
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
src: add equality operators for BaseObjectPtr
a3d0b0e
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
worker: allow passing JS wrapper objects via postMessage
9692208
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
worker,fs: make FileHandle transferable
5b1fd10
Allow passing `FileHandle` instances in the transfer list
of a `.postMessage()` call.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 27, 2020
@addaleax @codebytere
worker: emit 'messagerror' events for failed deserialization
4a37180
This is much nicer than just treating exceptions as uncaught, and
enables reporting of exceptions from the internal C++ deserialization
machinery.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@codebytere

codebytere commented Jun 27, 2020

Copy link
Copy Markdown
Member

Landed in 6dbd63c...4a37180

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codebytere codebytere closed this Jun 27, 2020
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
src: introduce BaseObject base FunctionTemplate
f50febc
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
worker: allow transferring/cloning generic BaseObjects
11daf8b
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
src: add equality operators for BaseObjectPtr
8be7c37
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
worker: allow passing JS wrapper objects via postMessage
c28726b
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
worker,fs: make FileHandle transferable
32bb67a
Allow passing `FileHandle` instances in the transfer list
of a `.postMessage()` call.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 30, 2020
@addaleax @codebytere
worker: emit 'messagerror' events for failed deserialization
6cd924d
This is much nicer than just treating exceptions as uncaught, and
enables reporting of exceptions from the internal C++ deserialization
machinery.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@addaleax
addaleax deleted the backport-v14.x-33772 branch August 17, 2020 20:51
addaleax added a commit that referenced this pull request Sep 22, 2020
@addaleax
src: add equality operators for BaseObjectPtr
19b55be
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 27, 2020
@addaleax
src: introduce BaseObject base FunctionTemplate
667d520
PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 27, 2020
@addaleax
worker: allow transferring/cloning generic BaseObjects
8e1698a
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 27, 2020
@addaleax
worker: allow passing JS wrapper objects via postMessage
0d35eaa
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.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 27, 2020
@addaleax
worker,fs: make FileHandle transferable
64f1ec5
Allow passing `FileHandle` instances in the transfer list
of a `.postMessage()` call.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 27, 2020
@addaleax
worker: emit 'messagerror' events for failed deserialization
eec836e
This is much nicer than just treating exceptions as uncaught, and
enables reporting of exceptions from the internal C++ deserialization
machinery.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 28, 2020
@addaleax
worker,fs: make FileHandle transferable
dd51ba3
Allow passing `FileHandle` instances in the transfer list
of a `.postMessage()` call.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
addaleax added a commit that referenced this pull request Sep 28, 2020
@addaleax
worker: emit 'messagerror' events for failed deserialization
dafa380
This is much nicer than just treating exceptions as uncaught, and
enables reporting of exceptions from the internal C++ deserialization
machinery.

PR-URL: #33772
Backport-PR-URL: #33965
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@codebytere codebytere codebytere approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@addaleax @nodejs-github-bot @codebytere
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.