Chromium Code Reviews
Help | Chromium Project | Sign in
(239)

Issue 391068: Add Blob API

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 5 months ago by ry
Modified:
4 years, 5 months ago
CC:
v8-dev_googlegroups.com
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -0 lines) Lint Patch
M include/v8.h View 4 chunks +36 lines, -0 lines 0 comments 0 errors Download
M src/api.h View 4 chunks +6 lines, -0 lines 0 comments 0 errors Download
M src/api.cc View 3 chunks +51 lines, -0 lines 3 comments ? errors Download
M test/cctest/test-api.cc View 1 chunk +33 lines, -0 lines 1 comment 1 errors Download
Trybot results: Sign in to try more bots
Commit:

Issue must be closed to Revert

Messages

Total messages: 5
ry
Hi Christian, Is this on the right track? What do you think about the GetAddress() ...
4 years, 5 months ago #1
Christian Plesner Hansen
I agree that SetIndexedPropertiesToExternalArrayData which was introduced only a few weeks ago is probably closer ...
4 years, 5 months ago #2
ry
On 2009/11/16 12:12:22, Christian Plesner Hansen wrote: > Except for giving out a derived pointer ...
4 years, 5 months ago #3
ry
Thinking about this some more, I suppose just using an External is probably best. I ...
4 years, 5 months ago #4
Christian Plesner Hansen
4 years, 5 months ago #5
> So, I'm trying to avoid a memcpy. I'd like to be able to recv() directly into
> the V8 heap. As long as no V8 functions are called, the GC shouldn't run.
Could
> a method like this be exposed if it was surrounded by a big scary warning and
> combined with safer WriteBytes() and ReadBytes() methods?

So far we've resisted the temptation to allow unsafe operations.  We could also
have used something like this for strings in the chromium binding layer but
decided against it then, and I don't see that changing.

> SetIndexedPropertiesToExternalArrayData() is not ideal because I'd like to
pass
> the data through V8, then have a C++ handler unwrap the data and access it
> again. (My use case is a TCP socket which receives data, passes it through V8,
> to a C-language HTTP parser.)

Unless the backing array has a life completely separate of the JS object it's
used in I don't know what prevents that.  You can make the backing array
available from the JS object and grab it when you need it in C++.

> Ideally I could use recv() into V8 Blob, pass it via Javascript to the parser,
> which could unwrap and parse the data without ever copying the data.

Our experience has been that memcpy usually isn't a bottleneck but that depends
on your application.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1275:d14800f88434