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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/util/ConversionUtils.java

Issue 2915863002: Photo Picker dialog: Add UMA statistics. (Closed)
Patch Set: Address feedback from Mark Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.util;
6
7 /**
8 * A class containing some utility static methods for common conversions.
9 */
10 public class ConversionUtils {
11 public static final int BYTES_PER_KILOBYTE = 1024;
12 public static final int BYTES_PER_MEGABYTE = 1024 * 1024;
13 public static final int BYTES_PER_GIGABYTE = 1024 * 1024 * 1024;
14
15 public static long bytesToKilobytes(long bytes) {
16 return bytes / BYTES_PER_KILOBYTE;
17 }
18
19 public static long bytesToMegabytes(long bytes) {
20 return bytes / BYTES_PER_MEGABYTE;
21 }
22
23 public static long bytesToGigabytes(long bytes) {
24 return bytes / BYTES_PER_GIGABYTE;
25 }
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698