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

Unified Diff: lib/utils.js

Issue 29329263: Issue 3108 - Less hacky approach to disabling E10S compatibility shims (Closed)
Patch Set: Created Oct. 16, 2015, 9:03 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 | « lib/main.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
===================================================================
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -375,16 +375,32 @@ let Utils = exports.Utils =
getParams: function()
{
let ret = sidebarParams;
sidebarParams = null;
return ret;
},
/**
+ * E10S compatibility shims will reroute property retrieval on some objects
+ * in order to enable custom behavior. This cannot be disabled on case by case
+ * basis (see https://bugzilla.mozilla.org/show_bug.cgi?id=1167802). So
+ * instead we use a different execution context to retrieve properties when
+ * E10S compatibility shims shouldn't kick in. This method simply returns
+ * obj[prop] but without any custom behavior.
+ */
+ getPropertyWithoutCompatShims: function(/**Object*/ obj, /**String*/ prop)
+ {
+ let sandbox = Cu.Sandbox(Utils.systemPrincipal);
+ sandbox.obj = obj;
+ sandbox.prop = prop;
+ return Cu.evalInSandbox("obj[prop]", sandbox);
+ },
+
+ /**
* Verifies RSA signature. The public key and signature should be base64-encoded.
* @param {string} key
* @param {string} signature
* @param {string} data
* @return {boolean}
*/
verifySignature: function(key, signature, data)
{
« no previous file with comments | « lib/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld