| Index: tools/dom/templates/html/impl/impl_StorageInfo.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_StorageInfo.darttemplate b/tools/dom/templates/html/impl/impl_StorageInfo.darttemplate
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..111ce8a4f81ae81a2ae9a19603b64ce45ee4c4b4
|
| --- /dev/null
|
| +++ b/tools/dom/templates/html/impl/impl_StorageInfo.darttemplate
|
| @@ -0,0 +1,29 @@
|
| +// 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.
|
| +
|
| +part of $LIBRARYNAME;
|
| +
|
| +$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| +$!MEMBERS
|
| + 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);
|
| +}
|
|
|