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

Unified Diff: sdk/lib/_internal/pub/lib/src/validator/size.dart

Issue 1165473002: Start pulling pub from its own repo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 7 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
Index: sdk/lib/_internal/pub/lib/src/validator/size.dart
diff --git a/sdk/lib/_internal/pub/lib/src/validator/size.dart b/sdk/lib/_internal/pub/lib/src/validator/size.dart
deleted file mode 100644
index b3da3883a020fbc731c4e20f17bf0e18cfd5ee47..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/validator/size.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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.
-
-library pub.validator.size;
-
-import 'dart:async';
-import 'dart:math' as math;
-
-import '../entrypoint.dart';
-import '../validator.dart';
-
-/// The maximum size of the package to upload (100 MB).
-const _MAX_SIZE = 100 * 1024 * 1024;
-
-/// A validator that validates that a package isn't too big.
-class SizeValidator extends Validator {
- final Future<int> packageSize;
-
- SizeValidator(Entrypoint entrypoint, this.packageSize)
- : super(entrypoint);
-
- Future validate() {
- return packageSize.then((size) {
- if (size <= _MAX_SIZE) return;
- var sizeInMb = (size / math.pow(2, 20)).toStringAsPrecision(4);
- errors.add("Your package is $sizeInMb MB. Hosted packages must be "
- "smaller than 100 MB.");
- });
- }
-}
-
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart ('k') | sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698