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

Unified Diff: sdk/lib/convert/utf.dart

Issue 144473004: Make _Utf8Encoder create its buffer through an external function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. 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 | « sdk/lib/_internal/lib/convert_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/utf.dart
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index 8e480f80333904569054ec0557754049fac40049..2f513b05ccc8fcabf11e53e2f22177a4fe4883ce 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -133,8 +133,13 @@ class _Utf8Encoder {
_Utf8Encoder() : this.withBufferSize(_DEFAULT_BYTE_BUFFER_SIZE);
_Utf8Encoder.withBufferSize(int bufferSize)
- // TODO(11971, floitsch): use Uint8List instead of normal lists.
- : _buffer = new List<int>(bufferSize);
+ : _buffer = _createBuffer(bufferSize);
+
+ // TODO(11971): Always use Uint8List.
+ /**
+ * Allow an implementation to pick the most efficient way of storing bytes.
+ */
+ external static List<int> _createBuffer(int size);
/**
* Tries to combine the given [leadingSurrogate] with the [nextCodeUnit] and
« no previous file with comments | « sdk/lib/_internal/lib/convert_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698