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

Side by Side Diff: content/browser/resources/media/new/util.js

Issue 23769009: Removes the --enable-new-media-internals flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unused files from old-media-internals Created 7 years, 3 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 2013 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 /**
6 * @fileoverview Some utility functions that don't belong anywhere else in the
7 * code.
8 */
9
10 var util = (function() {
11 var util = {};
12 util.object = {};
13 /**
14 * Calls a function for each element in an object/map/hash.
15 *
16 * @param obj The object to iterate over.
17 * @param f The function to call on every value in the object. F should have
18 * the following arguments: f(value, key, object) where value is the value
19 * of the property, key is the corresponding key, and obj is the object that
20 * was passed in originally.
21 * @param optObj The object use as 'this' within f.
22 */
23 util.object.forEach = function(obj, f, optObj) {
24 'use strict';
25 var key;
26 for (key in obj) {
27 if (obj.hasOwnProperty(key)) {
28 f.call(optObj, obj[key], key, obj);
29 }
30 }
31 };
32 util.millisecondsToString = function(timeMillis) {
33 function pad(num) {
34 num = num.toString();
35 if (num.length < 2) {
36 return '0' + num;
37 }
38 return num;
39 }
40
41 var date = new Date(timeMillis);
42 return pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' +
43 pad(date.getUTCSeconds()) + ' ' + pad((date.getMilliseconds()) % 1000);
44 };
45
46 return util;
47 }());
OLDNEW
« no previous file with comments | « content/browser/resources/media/new/player_info.js ('k') | content/browser/resources/media/player_info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698