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

Unified 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: Created 7 years, 5 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: content/browser/resources/media/new/util.js
diff --git a/content/browser/resources/media/new/util.js b/content/browser/resources/media/new/util.js
new file mode 100644
index 0000000000000000000000000000000000000000..adfcf4394a11c2b28352f341f0167cd5885d478a
--- /dev/null
+++ b/content/browser/resources/media/new/util.js
@@ -0,0 +1,29 @@
+// 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 Some utility functions that don't belong anywhere else in the
+ * code.
+ */
+
+var util = {};
scherkus (not reviewing) 2013/07/29 23:55:18 OOC is there a reason why this file doesn't use th
Ty Overby 2013/07/30 00:13:34 Because it doesn't need to? The only reason that
scherkus (not reviewing) 2013/07/30 03:12:08 Doesn't need to ... today ;) (I'm fine leaving as
+util.object = {};
+/**
+ * Calls a function for each element in an object/map/hash.
+ *
+ * @param {Object.<K,V>} obj The object over which to iterate.
+ * @param {function(this:T,V,?,Object<K,V>):?} f The function to call
+ * for every element. This function takes 3 arguments (the element, the
+ * index and the object) and the return value is ignored.
+ * @param {T=} opt_obj This is use as the 'this' object within f.
+ */
scherkus (not reviewing) 2013/07/29 23:55:18 this comment is copied verbatim from Apache-licens
Ty Overby 2013/07/30 00:13:34 The *code* was copied verbatim from the closure-cl
+util.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);
+ }
+ }
+};
« content/browser/resources/media/new/main.js ('K') | « 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