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

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: Addressed nit Created 5 years, 9 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
« no previous file with comments | « extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 616cc3fb3bf9779ccd6265e2dc2de79d57c4e179..97c797a0263f2421ec009d2cdf115cfaabda9a48 100644
--- a/extensions/renderer/resources/guest_view/guest_view.js
+++ b/extensions/renderer/resources/guest_view/guest_view.js
@@ -153,7 +153,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;
}
@@ -184,12 +183,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);
// Check if creation failed.
if (this.id === 0) {
this.state = GUEST_STATE_START;
+ this.contentWindow = null;
}
ResizeEvent.addListener(this.callOnResize, {instanceId: this.id});
@@ -247,7 +249,6 @@ GuestViewImpl.prototype.detachImpl = function(callback) {
this.internalInstanceId,
this.handleCallback.bind(this, callback));
- this.contentWindow = null;
this.internalInstanceId = 0;
this.state = GUEST_STATE_CREATED;
};
« no previous file with comments | « extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698