diff options
author | hansmuller <hansmuller@chromium.org> | 2014-09-25 11:41:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-25 18:42:04 +0000 |
commit | 5a5cb9e791961a2491c4269fc0f2144f385dc173 (patch) | |
tree | 14b352dc925a64dc7ef52df6b38991cb1ee79dde /mojo/mojo_base.gyp | |
parent | 1c863aa414026f2ece4ce5b930bcbce1cd07d6f0 (diff) | |
download | chromium_src-5a5cb9e791961a2491c4269fc0f2144f385dc173.zip chromium_src-5a5cb9e791961a2491c4269fc0f2144f385dc173.tar.gz chromium_src-5a5cb9e791961a2491c4269fc0f2144f385dc173.tar.bz2 |
Mojo JS bindings: draining a DataPipe
Add a drainData(dataPipeHandle) utility function to the Mojo JS core module.
The drainData() function asynchronously reads from the data pipe until the remote handle is closed or an error occurs. A Promise is returned whose settled value is an object like this: {result: core.RESULT_OK, buffer: dataArrayBuffer}. If the read failed, then the result will be the actual error code and the buffer will contain whatever was read before the error occurred. The drainData dataPipeHandle argument is closed automatically.
BUG=414338
Review URL: https://codereview.chromium.org/577733002
Cr-Commit-Position: refs/heads/master@{#296750}
Diffstat (limited to 'mojo/mojo_base.gyp')
-rw-r--r-- | mojo/mojo_base.gyp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mojo/mojo_base.gyp b/mojo/mojo_base.gyp index b7f2354..9f1127a 100644 --- a/mojo/mojo_base.gyp +++ b/mojo/mojo_base.gyp @@ -505,6 +505,8 @@ # Sources list duplicated in GN build. 'bindings/js/core.cc', 'bindings/js/core.h', + 'bindings/js/drain_data.cc', + 'bindings/js/drain_data.h', 'bindings/js/handle.cc', 'bindings/js/handle.h', 'bindings/js/handle_close_observer.h', |