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

Issue 364833002: Add typed data view creation functions on ByteBuffer. (Closed)

Created:
6 years, 5 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 5 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add typed data view creation functions on ByteBuffer. This provides a better model and better separation for typed data. Currently the only thing you can do with a ByteBuffer is pass it as argument to a typed data .view factory method, which then uses internal-only functionality to create the view. With this change, the functionality of creating the view, and understanding the internals of the ByteBuffer, is put on the ByteBuffer class itself. The view constructors on the typed data classes are retained, but they just forward to the buffer's method. This provides backwards compatibility and familiarity. This change allows mocking the ByteData object. There is no hidden connection between the constructor and the buffer that other objects can't implement. The change is non-breaking - it only adds methods to ByteBuffer, and there have been absolutely no reason to extend ByteBuffer until now, because it won't work anyway. R=asiva@google.com, sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=37974

Patch Set 1 #

Total comments: 1

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+429 lines, -248 lines) Patch
M runtime/lib/typed_data.dart View 30 chunks +117 lines, -202 lines 0 comments Download
M sdk/lib/typed_data/dart2js/native_typed_data_dart2js.dart View 1 chunk +46 lines, -0 lines 0 comments Download
M sdk/lib/typed_data/dart2js/typed_data_dart2js.dart View 14 chunks +76 lines, -15 lines 0 comments Download
M sdk/lib/typed_data/typed_data.dart View 16 chunks +120 lines, -30 lines 0 comments Download
M tests/standalone/typed_data_test.dart View 1 2 chunks +70 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
@Vijay: does this require changes in Dartium bindings?
6 years, 5 months ago (2014-07-02 12:05:59 UTC) #1
Søren Gjesse
LGTM https://codereview.chromium.org/364833002/diff/1/tests/standalone/typed_data_test.dart File tests/standalone/typed_data_test.dart (right): https://codereview.chromium.org/364833002/diff/1/tests/standalone/typed_data_test.dart#newcode307 tests/standalone/typed_data_test.dart:307: view = new ByteData.view(bytes, 24); Please add tests ...
6 years, 5 months ago (2014-07-02 13:06:14 UTC) #2
vsm
I don't expect this to require any bindings changes. We mostly use the VM's C++ ...
6 years, 5 months ago (2014-07-02 13:22:39 UTC) #3
siva
lgtm
6 years, 5 months ago (2014-07-02 22:48:28 UTC) #4
Lasse Reichstein Nielsen
Committed patchset #2 manually as r37974 (presubmit successful).
6 years, 5 months ago (2014-07-03 07:49:11 UTC) #5
Ivan Posva
6 years, 5 months ago (2014-07-03 08:37:56 UTC) #6
Message was sent while issue was closed.
Has this new public API on ByteBuffer been coordinated with John?

-Ivan

Powered by Google App Engine
This is Rietveld 408576698