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

Unified Diff: safari/ext/background.js

Issue 29333522: Issue 3515 - Adapted polyfill for URL class for consistency (Closed)
Patch Set: Use strict mode Created Jan. 15, 2016, 3:22 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
« lib/polyfill/url.js ('K') | « metadata.common ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/background.js
===================================================================
--- a/safari/ext/background.js
+++ b/safari/ext/background.js
@@ -167,34 +167,11 @@
var pages = Object.create(null);
var pageCounter = 0;
- var Frame = function(url, parent)
- {
- this._urlString = url;
- this._urlObj = null;
-
- this.parent = parent;
- }
- Frame.prototype = {
- get url()
- {
- // On Safari 6 and before, the URL constuctor doesn't exist.
- // The "urls" module provides a polifill, but it might not
- // be loaded yet. So we have to lazily parse URLs.
- if (!this._urlObj)
- {
- this._urlObj = new URL(this._urlString);
- this._urlString = null;
- }
-
- return this._urlObj;
- }
- };
-
var Page = function(id, tab, url)
{
this._id = id;
this._tab = tab;
- this._frames = [new Frame(url, null)];
+ this._frames = [{url: new URL(url), parent: null}];
if (tab.page)
this._messageProxy = new ext._MessageProxy(tab.page);
@@ -644,7 +621,7 @@
}
frameId = page._frames.length;
- page._frames.push(new Frame(message.url, parentFrame));
+ page._frames.push({url: new URL(message.url), parent: parentFrame});
}
event.message = {pageId: pageId, frameId: frameId};
break;
« lib/polyfill/url.js ('K') | « metadata.common ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld