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

Unified Diff: content/browser/resources/media/item_store.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/resources/media/event_list.js ('k') | content/browser/resources/media/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/media/item_store.js
diff --git a/content/browser/resources/media/item_store.js b/content/browser/resources/media/item_store.js
deleted file mode 100644
index a6e3a6c4577865aab9ea689922cea744a44b6987..0000000000000000000000000000000000000000
--- a/content/browser/resources/media/item_store.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2011 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.
-
-cr.define('media', function() {
-
- /**
- * This class stores hashes by their id field and provides basic methods for
- * iterating over the collection.
- * @constructor
- */
- function ItemStore() {
- this.items_ = {};
- }
-
- ItemStore.prototype = {
- /**
- * Get a sorted list of item ids.
- * @return {Array} A sorted array of ids.
- */
- ids: function() {
- var ids = [];
- for (var i in this.items_)
- ids.push(i);
- return ids.sort();
- },
-
- /**
- * Add an item to the store.
- * @param {Object} item The item to be added.
- * @param {string} item.id The id of the item.
- */
- addItem: function(item) {
- this.items_[item.id] = item;
- },
-
- /**
- * Add a dictionary of items to the store.
- * @param {Object} items A dictionary of individual items. The keys are
- * irrelevant but each must have an id field.
- */
- addItems: function(items) {
- for (id in items)
- this.addItem(items[id]);
- },
-
- /**
- * Remove an item from the store.
- * @param {string} id The id of the item to be removed.
- */
- removeItem: function(id) {
- delete this.items_[id];
- },
-
- /**
- * Map this itemStore to an Array. Items are sorted by id.
- * @param {function(*)} mapper The mapping function applied to each item.
- * @return {Array} An array of mapped items.
- */
- map: function(mapper) {
- var items = this.items_;
- var ids = this.ids();
- return ids.map(function(id) { return mapper(items[id]); });
- }
- };
-
- return {
- ItemStore: ItemStore
- };
-});
« no previous file with comments | « content/browser/resources/media/event_list.js ('k') | content/browser/resources/media/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698