Add StreamPromiseResolver

StreamPromiseResolver is a garbage-collected wrapper for
v8::Promise::Resolver that provides semantics matching those used for
promises in the streams standard.

Also add StreamScriptFunction, a subclass of ScriptFunction that avoids
the round-trip through ScriptValue, and StreamThenPromise(), a shortcut
for performing a Then operation where the functions are defined as

See design doc at


Change-Id: Ie363fb207a253a26a4bb622c50c304524d8651be
Reviewed-by: Yutaka Hirano <>
Commit-Queue: Adam Rice <>
Cr-Commit-Position: refs/heads/master@{#627888}
7 files changed