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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 1387273002: Fix Crypto.getRandomValues to modify its argument, fix tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/co19/co19-dartium.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 14fc413c973617e5c6b3cf992fb8f7e13e3e1fb8..1e25dea7ad6f79d111100d8de706a6a78c855ea9 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -5112,20 +5112,30 @@ class CredentialsContainer extends NativeFieldWrapperClass2 {
}
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
-
-@DocsEditable()
@DomName('Crypto')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/WebCryptoAPI/
class Crypto extends NativeFieldWrapperClass2 {
+
+ TypedData getRandomValues(TypedData array) {
+ var random = _getRandomValues(array);
+ // The semantics of the operation are that it modifies the argument, but we
+ // have no way of making a Dart typed data created initially in Dart reference
+ // externalized storage. So we copy the values back from the returned copy.
+ // TODO(alanknight): Make this less ridiculously slow.
+ for (var i = 0; i < random.length; i++) {
+ array[i] = random[i];
+ }
+ return array;
+ }
+
// To suppress missing implicit constructor warnings.
factory Crypto._() { throw new UnsupportedError("Not supported"); }
@@ -5154,7 +5164,7 @@ class Crypto extends NativeFieldWrapperClass2 {
@DomName('Crypto.getRandomValues')
@DocsEditable()
- TypedData getRandomValues(TypedData array) => wrap_jso(_blink.BlinkCrypto.instance.getRandomValues_Callback_1_(unwrap_jso(this), unwrap_jso(array)));
+ TypedData _getRandomValues(TypedData array) => wrap_jso(_blink.BlinkCrypto.instance.getRandomValues_Callback_1_(unwrap_jso(this), unwrap_jso(array)));
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
@@ -37231,10 +37241,10 @@ class Url extends NativeFieldWrapperClass2 implements UrlUtils {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
- if ((blob_OR_source_OR_stream is MediaStream)) {
+ if ((blob_OR_source_OR_stream is MediaSource)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
- if ((blob_OR_source_OR_stream is MediaSource)) {
+ if ((blob_OR_source_OR_stream is MediaStream)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
throw new ArgumentError("Incorrect number or type of arguments");
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/co19/co19-dartium.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698