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

Unified Diff: sdk/lib/typed_data/typed_data.dart

Issue 138033002: Make VM TypedList not implement ByteBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove cast. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/typed_data/typed_data.dart
diff --git a/sdk/lib/typed_data/typed_data.dart b/sdk/lib/typed_data/typed_data.dart
index 413eff3a3850a24f0998330b8e5a018c0fc43acf..899fa0c691e45aa9f4d67a11b128a610c220b7f3 100644
--- a/sdk/lib/typed_data/typed_data.dart
+++ b/sdk/lib/typed_data/typed_data.dart
@@ -10,6 +10,10 @@ import 'dart:collection';
* A sequence of bytes underlying a typed data object.
* Used to process large quantities of binary or numerical data
* more efficiently using a typed view.
+ *
+ * The `ByteBuffer` instances created by this library are the only ones
+ * that will work with the `view` constructors.
+ * Creating a class implementing `ByteBuffer` will not make it usable.
*/
abstract class ByteBuffer {
/**
@@ -17,6 +21,15 @@ abstract class ByteBuffer {
*/
int get lengthInBytes;
+ int get hashCode;
+
+ /**
+ * Is [other] a `ByteBuffer` holding the same memory as this.
+ *
+ * A `ByteBuffer` is only equal to another `ByteBuffer` that
+ * represents the same underlying memory.
+ */
+ bool operator==(Object other);
}
@@ -42,6 +55,10 @@ abstract class TypedData {
/**
* Returns the byte buffer associated with this object.
+ *
+ * The returned object represents the underlying memory.
+ * It may be the same object returned each time, or a new object representing
+ * the same memory.
*/
ByteBuffer get buffer;
}
@@ -52,8 +69,6 @@ abstract class TypedData {
* sequence of bytes.
*/
class Endianness {
- const Endianness._(this._littleEndian);
-
static const Endianness BIG_ENDIAN = const Endianness._(false);
static const Endianness LITTLE_ENDIAN = const Endianness._(true);
static final Endianness HOST_ENDIAN =
@@ -61,6 +76,8 @@ class Endianness {
LITTLE_ENDIAN : BIG_ENDIAN;
final bool _littleEndian;
+
+ const Endianness._(this._littleEndian);
}
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698