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

Unified Diff: chrome/renderer/resources/extensions/platform_keys/key.js

Issue 1915753002: Sanitize inheritance in callers of utils.expose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit: space after ':' Created 4 years, 8 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: chrome/renderer/resources/extensions/platform_keys/key.js
diff --git a/chrome/renderer/resources/extensions/platform_keys/key.js b/chrome/renderer/resources/extensions/platform_keys/key.js
index bea1fc402a187f89a335f8d7575752fcca58b4b1..bde4c85685531c3aaa423064e4680ccd12fe8e08 100644
--- a/chrome/renderer/resources/extensions/platform_keys/key.js
+++ b/chrome/renderer/resources/extensions/platform_keys/key.js
@@ -9,6 +9,7 @@ var utils = require('utils');
* @enum {string}
*/
var KeyType = {
+ __proto__: null,
public: 'public',
private: 'private'
};
@@ -18,6 +19,7 @@ var KeyType = {
* @enum {string}
*/
var KeyUsage = {
+ __proto__: null,
sign: 'sign',
verify: 'verify'
};
@@ -32,22 +34,25 @@ var KeyUsage = {
* @param {boolean} extractable Whether the key is extractable.
* @constructor
*/
-var KeyImpl = function(type, publicKeySpki, algorithm, usages, extractable) {
+function KeyImpl(type, publicKeySpki, algorithm, usages, extractable) {
this.type = type;
this.spki = publicKeySpki;
this.algorithm = algorithm;
this.usages = usages;
this.extractable = extractable;
-};
-
-var KeyBase = function() {};
+}
+$Object.setPrototypeOf(KeyImpl.prototype, null);
-Object.defineProperty(KeyBase.prototype, 'algorithm', {
- enumerable: true,
- get: function() {
+/**
+ * The public base class of Key.
+ */
+function KeyBase() {}
+KeyBase.prototype = {
+ constructor: KeyBase,
+ get algorithm() {
return utils.deepCopy(privates(this).impl.algorithm);
- }
-});
+ },
+};
function Key() {
privates(Key).constructPrivate(this, arguments);

Powered by Google App Engine
This is Rietveld 408576698