 Chromium Code Reviews
 Chromium Code Reviews Issue 1915753002:
  Sanitize inheritance in callers of utils.expose  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1915753002:
  Sanitize inheritance in callers of utils.expose  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js | 
| diff --git a/chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js b/chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js | 
| index 1cab18f8487051fc6cbc8e4829029473b54581a7..cffc6619b9e18761bc4d04a590fe558478be38cf 100644 | 
| --- a/chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js | 
| +++ b/chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js | 
| @@ -11,13 +11,14 @@ var KeyUsage = keyModule.KeyUsage; | 
| /** | 
| * Implementation of WebCrypto.KeyPair used in enterprise.platformKeys. | 
| + * | 
| 
Devlin
2016/04/26 22:41:25
I don't think this is typical style.  Please rever
 
robwu
2016/04/26 23:14:33
Done.
 | 
| * @param {ArrayBuffer} publicKeySpki The Subject Public Key Info in DER | 
| * encoding. | 
| * @param {KeyAlgorithm} algorithm The algorithm identifier. | 
| * @param {KeyUsage[]} usages The allowed key usages. | 
| * @constructor | 
| */ | 
| -var KeyPairImpl = function(publicKeySpki, algorithm, usages) { | 
| +function KeyPairImpl(publicKeySpki, algorithm, usages) { | 
| this.publicKey = new Key(KeyType.public, | 
| publicKeySpki, | 
| algorithm, | 
| @@ -28,7 +29,9 @@ var KeyPairImpl = function(publicKeySpki, algorithm, usages) { | 
| algorithm, | 
| intersect([KeyUsage.sign], usages), | 
| false /* not extractable */); | 
| -}; | 
| +} | 
| +$Object.setPrototypeOf(KeyPairImpl, null); | 
| +$Object.setPrototypeOf(KeyPairImpl.prototype, null); | 
| 
Devlin
2016/04/26 22:41:25
Why do we need this?
 
robwu
2016/04/26 23:14:33
By default, instances inherit from Object, which c
 
Devlin
2016/04/27 00:10:25
I should have been more clear.  Why do we need to
 
robwu
2016/04/27 09:09:21
On prototype for the reason above.
On the construc
 
Devlin
2016/04/27 17:33:02
Hmm... I'm a bit torn on this.
A few of the v8 fo
 
robwu
2016/04/28 20:27:50
Done.
 | 
| function KeyPair() { | 
| privates(KeyPair).constructPrivate(this, arguments); |