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

Unified Diff: extensions/renderer/resources/guest_view/guest_view.js

Issue 910073003: <webview>: Make contentWindow available prior to attachment (on display:none). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use constants Created 5 years, 10 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: 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;
};

Powered by Google App Engine
This is Rietveld 408576698