Chromium Code Reviews| Index: extensions/renderer/resources/guest_view/guest_view.js |
| diff --git a/extensions/renderer/resources/guest_view/guest_view.js b/extensions/renderer/resources/guest_view/guest_view.js |
| index 8ff4f3c52b30d52bce6d408d72adbc25404e505b..9cdb410d33cc23dfe2bce79b0379643db8a8df86 100644 |
| --- a/extensions/renderer/resources/guest_view/guest_view.js |
| +++ b/extensions/renderer/resources/guest_view/guest_view.js |
| @@ -156,7 +156,6 @@ GuestViewImpl.prototype.attachImpl = function( |
| GuestViewInternalNatives.RegisterDestructionCallback(internalInstanceId, |
| function() { |
| if (this.state == GUEST_STATE_ATTACHED) { |
| - this.contentWindow = null; |
| this.internalInstanceId = 0; |
| this.state = GUEST_STATE_CREATED; |
| } |
| @@ -187,12 +186,15 @@ GuestViewImpl.prototype.createImpl = function(createParams, callback) { |
| // Callback wrapper function to store the guestInstanceId from the |
| // createGuest() callback, handle potential creation failure, and advance the |
| // queue. |
| - var callbackWrapper = function(callback, guestInstanceId) { |
| - this.id = guestInstanceId; |
| + var callbackWrapper = function(callback, guestInfo) { |
| + this.id = guestInfo.id; |
| + this.contentWindow = |
| + GuestViewInternalNatives.GetContentWindow(guestInfo.contentWindowId); |
|
lfg
2015/03/04 19:10:20
This is ok, but I think it would it be nicer to pa
Fady Samuel
2015/03/05 20:56:23
I'll do that in a separate patch. I don't want to
|
| // Check if creation failed. |
| if (this.id === 0) { |
| this.state = GUEST_STATE_START; |
| + this.contentWindow = null; |
| } |
| ResizeEvent.addListener(this.callOnResize, {instanceId: this.id}); |
| @@ -250,7 +252,6 @@ GuestViewImpl.prototype.detachImpl = function(callback) { |
| this.internalInstanceId, |
| this.handleCallback.bind(this, callback)); |
| - this.contentWindow = null; |
| this.internalInstanceId = 0; |
| this.state = GUEST_STATE_CREATED; |
| }; |