Chromium Code Reviews| Index: content/browser/resources/media/new/goog.js |
| diff --git a/content/browser/resources/media/new/goog.js b/content/browser/resources/media/new/goog.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6137eff22460d28edbfaa7a3c1167d761c58aaac |
| --- /dev/null |
| +++ b/content/browser/resources/media/new/goog.js |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| + |
| +/** |
| + * @fileoverview A placeholder for google closure library functions. |
|
scherkus (not reviewing)
2013/07/29 22:16:28
want to rename this file util.js and introduce hel
Ty Overby
2013/07/29 22:47:22
Done.
|
| + */ |
| + |
| +var goog = {}; |
| +goog.object = {}; |
| +goog.object.forEach = function(obj, f, optObj) { |
| + 'use strict'; |
| + var key; |
| + for (key in obj) { |
| + if (obj.hasOwnProperty(key)) { |
| + f.call(optObj, obj[key], key, obj); |
| + } |
| + } |
| +}; |
| + |
| +goog.time = {}; |
| +goog.time.millisToString = function(timeMillis) { |
|
scherkus (not reviewing)
2013/07/29 22:16:28
is this function used anywhere yet?
if not, pleas
Ty Overby
2013/07/29 22:47:22
Done.
|
| + 'use strict'; |
| + function pad(num) { |
| + num = num.toString(); |
| + if (num.length < 2) { |
| + return '0' + num; |
| + } |
| + return num; |
| + } |
| + |
| + var date = new Date(timeMillis); |
| + return pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + |
| + pad(date.getUTCSeconds()) + ' ' + pad((date.getMilliseconds()) % 1000); |
| +}; |