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

Side by Side Diff: chrome/renderer/resources/extensions/automation/automation_event.js

Issue 1915753002: Sanitize inheritance in callers of utils.expose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webview: Set proto on prototype. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var utils = require('utils'); 5 var utils = require('utils');
6 6
7 var AutomationEventImpl = function(type, target) { 7 function AutomationEventImpl(type, target) {
8 this.propagationStopped = false; 8 this.propagationStopped = false;
9 9
10 // TODO(aboxhall): make these read-only properties 10 // TODO(aboxhall): make these read-only properties
11 this.type = type; 11 this.type = type;
12 this.target = target; 12 this.target = target;
13 this.eventPhase = Event.NONE; 13 this.eventPhase = Event.NONE;
14 }; 14 }
15 $Object.setPrototypeOf(AutomationEventImpl, null);
15 16
16 AutomationEventImpl.prototype = { 17 AutomationEventImpl.prototype = {
18 __proto__: null,
17 stopPropagation: function() { 19 stopPropagation: function() {
18 this.propagationStopped = true; 20 this.propagationStopped = true;
19 } 21 },
20 }; 22 };
21 23
22 function AutomationEvent() { 24 function AutomationEvent() {
23 privates(AutomationEvent).constructPrivate(this, arguments); 25 privates(AutomationEvent).constructPrivate(this, arguments);
24 } 26 }
25 utils.expose(AutomationEvent, AutomationEventImpl, { 27 utils.expose(AutomationEvent, AutomationEventImpl, {
26 functions: [ 28 functions: [
27 'stopPropagation', 29 'stopPropagation',
28 ], 30 ],
29 readonly: [ 31 readonly: [
30 'type', 32 'type',
31 'target', 33 'target',
32 'eventPhase', 34 'eventPhase',
33 ], 35 ],
34 }); 36 });
35 37
36 exports.$set('AutomationEvent', AutomationEvent); 38 exports.$set('AutomationEvent', AutomationEvent);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698