Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/background.js

Issue 6528746257383424: Issue 1708 - Integrate first-run page changes in Chrome/Opera/Safari (Closed)
Patch Set: Rebased Created Dec. 19, 2014, 8:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/ext/background.js ('k') | include.postload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
===================================================================
--- a/ext/background.js
+++ b/ext/background.js
@@ -17,27 +17,31 @@
(function()
{
var nonEmptyPageMaps = {__proto__: null};
var pageMapCounter = 0;
var PageMap = ext.PageMap = function()
{
- this._map = {__proto__: null};
+ this._map = Object.create(null);
this._id = ++pageMapCounter;
};
PageMap.prototype = {
_delete: function(id)
{
delete this._map[id];
if (Object.keys(this._map).length == 0)
delete nonEmptyPageMaps[this._id];
},
+ keys: function()
+ {
+ return Object.keys(this._map).map(ext._getPage);
+ },
get: function(page)
{
return this._map[page._id];
},
set: function(page, value)
{
this._map[page._id] = value;
nonEmptyPageMaps[this._id] = this;
« no previous file with comments | « chrome/ext/background.js ('k') | include.postload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld