Chromium Code Reviews| 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..7670ba1f867b62b2d0e5ef1aa8fb28790263e97e |
| --- /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<int>(); |
| + _queryUsageAndQuota(storageType, |
| + (currentUsageInBytes, currentQuotaInBytes) { |
|
Andrei Mouravski
2013/03/15 21:08:16
You could use an => here, too.
|
| + completer.complete(new StorageInfoUsage(currentUsageInBytes, |
| + currentQuotaInBytes)); |
|
Andrei Mouravski
2013/03/15 21:08:16
There should be 2 more spaces before "currentQuota
Emily Fortuna
2013/03/15 23:03:24
Done.
|
| + }, |
| + (error) { completer.completeError(error); }); |
|
Andrei Mouravski
2013/03/15 21:08:16
Just use an =>
|
| + return completer.future; |
| + } |
| +} |
| + |
| +/** |
| + * A simple container class for the two values that are returned from the |
|
Andrei Mouravski
2013/03/15 21:08:16
I'd simplify this to:
"A container class for the u
Andrei Mouravski
2013/03/15 23:09:33
No change on this?
|
| + * futures in requestQuota and queryUsageAndQuota. |
|
Andrei Mouravski
2013/03/15 21:08:16
You don't need to mention the methods that produce
|
| + */ |
| +class StorageInfoUsage { |
| + int currentUsageInBytes; |
|
blois
2013/03/15 20:38:44
these should be final.
|
| + int currentQuotaInBytes; |
| + StorageInfoUsage(this.currentUsageInBytes, this.currentQuotaInBytes); |
|
Andrei Mouravski
2013/03/15 21:08:16
Make this a const constructor.
|
| +} |