OLD | NEW |
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 // This module implements a wrapper for a guestview that manages its | 5 // This module implements a wrapper for a guestview that manages its |
6 // creation, attaching, and destruction. | 6 // creation, attaching, and destruction. |
7 | 7 |
8 var CreateEvent = require('guestViewEvents').CreateEvent; | 8 var CreateEvent = require('guestViewEvents').CreateEvent; |
9 var EventBindings = require('event_bindings'); | 9 var EventBindings = require('event_bindings'); |
10 var GuestViewInternal = getInternalApi ? | 10 var GuestViewInternal = getInternalApi ? |
(...skipping 30 matching lines...) Expand all Loading... |
41 this.guestView = guestView; | 41 this.guestView = guestView; |
42 this.pendingAction = null; | 42 this.pendingAction = null; |
43 this.viewType = viewType; | 43 this.viewType = viewType; |
44 this.internalInstanceId = 0; | 44 this.internalInstanceId = 0; |
45 | 45 |
46 this.setupOnResize(); | 46 this.setupOnResize(); |
47 } | 47 } |
48 | 48 |
49 // Prevent GuestViewImpl inadvertently inheriting code from the global Object, | 49 // Prevent GuestViewImpl inadvertently inheriting code from the global Object, |
50 // allowing a pathway for executing unintended user code execution. | 50 // allowing a pathway for executing unintended user code execution. |
| 51 // TODO(wjmaclean): Use utils.expose() here instead? Track down other issues |
| 52 // of Object inheritance. https://crbug.com/701034 |
51 GuestViewImpl.prototype.__proto__ = null; | 53 GuestViewImpl.prototype.__proto__ = null; |
52 | 54 |
53 // Possible states. | 55 // Possible states. |
54 GuestViewImpl.GuestState = { | 56 GuestViewImpl.GuestState = { |
55 GUEST_STATE_START: 0, | 57 GUEST_STATE_START: 0, |
56 GUEST_STATE_CREATED: 1, | 58 GUEST_STATE_CREATED: 1, |
57 GUEST_STATE_ATTACHED: 2 | 59 GUEST_STATE_ATTACHED: 2 |
58 }; | 60 }; |
59 | 61 |
60 // Sets up the onResize property on the GuestView. | 62 // Sets up the onResize property on the GuestView. |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 var internal = privates(this).internal; | 355 var internal = privates(this).internal; |
354 return internal.id; | 356 return internal.id; |
355 }; | 357 }; |
356 | 358 |
357 // Exports | 359 // Exports |
358 if (!apiBridge) { | 360 if (!apiBridge) { |
359 exports.$set('GuestView', GuestView); | 361 exports.$set('GuestView', GuestView); |
360 exports.$set('GuestViewImpl', GuestViewImpl); | 362 exports.$set('GuestViewImpl', GuestViewImpl); |
361 exports.$set('ResizeEvent', ResizeEvent); | 363 exports.$set('ResizeEvent', ResizeEvent); |
362 } | 364 } |
OLD | NEW |