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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 12653008: Fix up static analysis errors introduced by Futures CL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index c9a2e978758cb7a5be3515f04b93a3f5d5e8d0d1..c771345ef406a5ae350bf78da42144e1c60936dd 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -19484,6 +19484,21 @@ class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
} catch (_) {}
return false;
}
+ Future<RtcSessionDescription> createOffer([Map mediaConstraints]) {
+ var completer = new Completer<RtcSessionDescription>();
+ _createOffer(
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); }, mediaConstraints);
+ return completer.future;
+ }
+
+ Future<RtcSessionDescription> createAnswer([Map mediaConstraints]) {
+ var completer = new Completer<RtcSessionDescription>();
+ _createAnswer(
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); }, mediaConstraints);
+ return completer.future;
+ }
@DomName('RTCPeerConnection.addstreamEvent')
@DocsEditable
@@ -19594,17 +19609,6 @@ class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
@DocsEditable
void __createAnswer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
- @JSName('createAnswer')
- @DomName('RTCPeerConnection.createAnswer')
- @DocsEditable
- Future<RtcSessionDescription> createAnswer([Map mediaConstraints]) {
- var completer = new Completer<RtcSessionDescription>();
- _createAnswer(mediaConstraints,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
-
@JSName('createDTMFSender')
@DomName('RTCPeerConnection.createDTMFSender')
@DocsEditable
@@ -19648,17 +19652,6 @@ class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
@DocsEditable
void __createOffer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
- @JSName('createOffer')
- @DomName('RTCPeerConnection.createOffer')
- @DocsEditable
- Future<RtcSessionDescription> createOffer([Map mediaConstraints]) {
- var completer = new Completer<RtcSessionDescription>();
- _createOffer(mediaConstraints,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
-
@DomName('RTCPeerConnection.dispatchEvent')
@DocsEditable
bool dispatchEvent(Event event) native;
@@ -21294,12 +21287,11 @@ class StorageEvent extends Event native "*StorageEvent" {
void $dom_initStorageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, String keyArg, String oldValueArg, String newValueArg, String urlArg, Storage storageAreaArg) native;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, 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.
-@DocsEditable
@DomName('StorageInfo')
class StorageInfo native "*StorageInfo" {
@@ -21312,17 +21304,6 @@ class StorageInfo native "*StorageInfo" {
@DocsEditable
void _queryUsageAndQuota(int storageType, [_StorageInfoUsageCallback usageCallback, _StorageInfoErrorCallback errorCallback]) native;
- @JSName('queryUsageAndQuota')
- @DomName('StorageInfo.queryUsageAndQuota')
- @DocsEditable
- Future<int> queryUsageAndQuota(int storageType) {
- var completer = new Completer<int>();
- _queryUsageAndQuota(storageType,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
-
@JSName('requestQuota')
@DomName('StorageInfo.requestQuota')
@DocsEditable
@@ -21338,6 +21319,27 @@ class StorageInfo native "*StorageInfo" {
(error) { completer.completeError(error); });
return completer.future;
}
+
+ Future<StorageInfoUsage> queryUsageAndQuota(int storageType) {
+ var completer = new Completer<StorageInfoUsage>();
+ _queryUsageAndQuota(storageType,
+ (currentUsageInBytes, currentQuotaInBytes) {
+ completer.complete(new StorageInfoUsage(currentUsageInBytes,
+ currentQuotaInBytes));
+ },
+ (error) { completer.completeError(error); });
+ return completer.future;
+ }
+}
+
+/**
+ * A simple container class for the two values that are returned from the
+ * futures in requestQuota and queryUsageAndQuota.
+ */
+class StorageInfoUsage {
+ final int currentUsageInBytes;
+ final int currentQuotaInBytes;
+ const StorageInfoUsage(this.currentUsageInBytes, this.currentQuotaInBytes);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -32175,7 +32177,7 @@ class _HttpRequestUtils {
onComplete(HttpRequest request),
bool withCredentials) {
final request = new HttpRequest();
- request.open('GET', url, true);
+ request.open('GET', url, async: true);
request.withCredentials = withCredentials;
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698