diff options
author | abarth <abarth@chromium.org> | 2014-10-07 21:14:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-08 04:14:38 +0000 |
commit | dd41cde58eaf5a03b0012b4ea9e0a14344d8e45d (patch) | |
tree | 83b2f0a3eb3dc68a7544c7a86036c083fc9d3042 | |
parent | d623a521ab5e9c635042f41bf38d081253718f40 (diff) | |
download | chromium_src-dd41cde58eaf5a03b0012b4ea9e0a14344d8e45d.zip chromium_src-dd41cde58eaf5a03b0012b4ea9e0a14344d8e45d.tar.gz chromium_src-dd41cde58eaf5a03b0012b4ea9e0a14344d8e45d.tar.bz2 |
[Mojo] core.drainData should take ownership of the handle
mojo::js::DrainData holds the data pipe handle with
ScopedDataPipeConsumerHandle, which closes the handle upon destruction.
Previously, the handle was also owned by the HandleWrapper in the JS bindings.
After this CL, core.drainData transfers ownership of the handle from
HandleWrapper to DrainData, preventing us from closing the handle twice.
R=hans@chromium.org
Review URL: https://codereview.chromium.org/637053002
Cr-Commit-Position: refs/heads/master@{#298652}
-rw-r--r-- | mojo/bindings/js/core.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mojo/bindings/js/core.cc b/mojo/bindings/js/core.cc index 9ab2f19..e116db1 100644 --- a/mojo/bindings/js/core.cc +++ b/mojo/bindings/js/core.cc @@ -230,8 +230,9 @@ gin::Dictionary ReadData(const gin::Arguments& args, // and the buffer will contain whatever was read before the error occurred. // The drainData data pipe handle argument is closed automatically. -v8::Handle<v8::Value> DoDrainData(gin::Arguments* args, mojo::Handle handle) { - return (new DrainData(args->isolate(), handle))->GetPromise(); +v8::Handle<v8::Value> DoDrainData(gin::Arguments* args, + gin::Handle<gin::HandleWrapper> handle) { + return (new DrainData(args->isolate(), handle->release()))->GetPromise(); } gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin }; |