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

Issue 10544110: Fix file buffering code that uses RemoveRange on a fixed-length Uint8 array. (Closed)

Created:
8 years, 6 months ago by Bill Hesse
Modified:
8 years, 6 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix file buffering code that uses RemoveRange on a fixed-length Uint8 array. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8548

Patch Set 1 #

Total comments: 3

Patch Set 2 : Switch to getRange. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M runtime/bin/file_impl.dart View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Bill Hesse
8 years, 6 months ago (2012-06-12 13:36:15 UTC) #1
Anders Johnsen
http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart#newcode75 runtime/bin/file_impl.dart:75: var oldData = _data; What about _data = _data.getRange(0, ...
8 years, 6 months ago (2012-06-12 13:42:33 UTC) #2
Bill Hesse
http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart#newcode75 runtime/bin/file_impl.dart:75: var oldData = _data; On 2012/06/12 13:42:33, ajohnsen wrote: ...
8 years, 6 months ago (2012-06-12 13:47:45 UTC) #3
Anders Johnsen
8 years, 6 months ago (2012-06-12 13:51:24 UTC) #4
LGTM

http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart
File runtime/bin/file_impl.dart (right):

http://codereview.chromium.org/10544110/diff/1/runtime/bin/file_impl.dart#new...
runtime/bin/file_impl.dart:75: var oldData = _data;
On 2012/06/12 13:47:45, Bill Hesse wrote:
> On 2012/06/12 13:42:33, ajohnsen wrote:
> > What about
> >  _data = _data.getRange(0, read);
> 
> I don't know if that would be a Uint8List.  Since a Uint8List is a different
> type of thing than a List, I
> don't want to return things of different types.

.getRange() is a object of same type (see runtime/lib/byte_array.dart), using a
native call to copy into the new list. It should be fairly safe to use here. In
the end, the result will be the same, so I'll leave it up to you.

Powered by Google App Engine
This is Rietveld 408576698