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

Unified Diff: utils/archive/reader.dart

Issue 10824210: Fix the archive code so that it compiles in a stricter mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small fixes Created 8 years, 4 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 | « utils/archive/reader.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/archive/reader.dart
diff --git a/utils/archive/reader.dart b/utils/archive/reader.dart
index 3a2830fecacb2828f2f96f7882a8ca35a9a1c10e..2336970d5e9b54a6ec7fd388ea1febc3557de76a 100644
--- a/utils/archive/reader.dart
+++ b/utils/archive/reader.dart
@@ -125,18 +125,29 @@ class ArchiveReader {
if (format.zip) pending.add(call(SUPPORT_FORMAT_ZIP, id));
}
- if (!filter.options.isEmpty) {
- pending.add(
- call(SET_FILTER_OPTIONS, id, [filter.options.serialize()]));
+ var addOption = (request, option) {
+ var value;
+ if (option.value == false || option.value == null) {
+ value = null;
+ } else if (option.value == true) {
+ value = '1';
+ } else {
+ value = option.value.toString();
+ }
+
+ pending.add(CALL(request, id, [module, option.name, value]));
+ };
+
+ for (var option in filter.options.all) {
+ addOption(SET_FILTER_OPTION, option);
}
- if (!format.options.isEmpty) {
- pending.add(
- call(SET_FORMAT_OPTIONS, id, [format.options.serialize()]));
+ for (var option in format.options.all) {
+ addOption(SET_FORMAT_OPTION, option);
}
- if (!options.isEmpty) {
- pending.add(call(SET_OPTIONS, id, [options.serialize()]));
+ for (var option in options.all) {
+ addOption(SET_OPTION, option);
}
return Futures.wait(pending);
« no previous file with comments | « utils/archive/reader.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698