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

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

Issue 20804002: Added the next series of files that go into media-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wraped util in a module Created 7 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 unified diff | Download patch
« no previous file with comments | « content/browser/resources/media/new/main.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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
33 return util;
34 }());
OLDNEW
« no previous file with comments | « content/browser/resources/media/new/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698