Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Issue 10698011: Support posting of external data into dart as external uint8 arrays through the Dart API. (Closed)

Created:
8 years, 5 months ago by Mads Ager (google)
Modified:
8 years, 5 months ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Support posting of external data into dart as external uint8 arrays through the Dart API. The native ports use the snapshot reader to create the dart objects. Added support for reading external arrays from snapshots but no support for writing them. The only way an external array is written to a snapshot is through the api message writer. This allows dart:io to avoid one copy of data read from files and sockets. This change only contains one use of the new API. R=asiva@google.com,iposva@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=9281

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -38 lines) Patch
M runtime/bin/dartutils.h View 1 12 chunks +52 lines, -2 lines 0 comments Download
M runtime/bin/dartutils.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M runtime/bin/file.h View 1 1 chunk +2 lines, -4 lines 0 comments Download
M runtime/bin/file.cc View 2 chunks +15 lines, -5 lines 0 comments Download
M runtime/bin/file_linux.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M runtime/bin/file_macos.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M runtime/bin/file_win.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M runtime/include/dart_api.h View 2 chunks +7 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_message.cc View 1 1 chunk +21 lines, -0 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 4 chunks +26 lines, -18 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mads Ager (google)
8 years, 5 months ago (2012-06-27 19:52:28 UTC) #1
siva
LGTM, We could add the notion of restricting post of these messages to any external ...
8 years, 5 months ago (2012-06-28 16:44:05 UTC) #2
Mads Ager (google)
Thanks Siva! http://codereview.chromium.org/10698011/diff/1/runtime/bin/dartutils.h File runtime/bin/dartutils.h (right): http://codereview.chromium.org/10698011/diff/1/runtime/bin/dartutils.h#newcode322 runtime/bin/dartutils.h:322: } On 2012/06/28 16:44:05, asiva wrote: > ...
8 years, 5 months ago (2012-06-28 18:06:51 UTC) #3
Mads Ager (google)
8 years, 5 months ago (2012-07-02 07:24:02 UTC) #4
Ivan, I landed the changelist. I will address any comments you might have as a
separate changelist.

On 2012/06/28 18:06:51, Mads Ager wrote:
> Thanks Siva!
> 
> http://codereview.chromium.org/10698011/diff/1/runtime/bin/dartutils.h
> File runtime/bin/dartutils.h (right):
> 
>
http://codereview.chromium.org/10698011/diff/1/runtime/bin/dartutils.h#newcod...
> runtime/bin/dartutils.h:322: }
> On 2012/06/28 16:44:05, asiva wrote:
> > DISALLOW_COPY_AND_ASSIGN(...);
> > 
> > Seems to be missing in all the classes in this file, not sure why.
> 
> Me neither, but they are there now. Thanks. :)
> 
> http://codereview.chromium.org/10698011/diff/1/runtime/vm/dart_api_message.cc
> File runtime/vm/dart_api_message.cc (right):
> 
>
http://codereview.chromium.org/10698011/diff/1/runtime/vm/dart_api_message.cc...
> runtime/vm/dart_api_message.cc:731:
> WriteIntptrValue(reinterpret_cast<intptr_t>(callback));
> On 2012/06/28 16:44:05, asiva wrote:
> > As discussed offline we need some mechanism to ensure that this message is
not
> > posted to an external process. maybe you could add a TODO here to that
effect.
> 
> Done.
> 
>
http://codereview.chromium.org/10698011/diff/1/runtime/vm/raw_object_snapshot.cc
> File runtime/vm/raw_object_snapshot.cc (right):
> 
>
http://codereview.chromium.org/10698011/diff/1/runtime/vm/raw_object_snapshot...
> runtime/vm/raw_object_snapshot.cc:1812: Snapshot::Kind kind) {                
 
>                                   \
> On 2012/06/28 16:44:05, asiva wrote:
> > ASSERT(kind != Snapshot::kFull);
> > or
> > if (kind == Snapshot::kFull) {
> >   UNREACHABLE();
> > }
> 
> Added the ASSERT. Thanks!

Powered by Google App Engine
This is Rietveld 408576698