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

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

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix extensionoptions cleanup Created 6 years, 3 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/web_view.js
diff --git a/extensions/renderer/resources/web_view.js b/extensions/renderer/resources/web_view.js
index 3cf20f99835ca7b7227206238bdc9d12645290bf..7f68ba4c2237c2e868d0a08b50ab6729a6492b46 100644
--- a/extensions/renderer/resources/web_view.js
+++ b/extensions/renderer/resources/web_view.js
@@ -142,6 +142,7 @@ WebViewInternal.prototype.reset = function() {
// heard back from createGuest yet. We will not reset the flag in this case so
// that we don't end up allocating a second guest.
if (this.guestInstanceId) {
+ GuestViewInternal.destroyGuest(this.guestInstanceId);
lfg 2014/09/30 18:59:27 If a webview element is attached and immediatelly
Fady Samuel 2014/09/30 22:50:03 Fixed..I think but this code is VERY brittle now.
lfg 2014/09/30 23:29:42 Acknowledged.
this.guestInstanceId = undefined;
this.beforeFirstNavigation = true;
this.validPartitionId = true;
@@ -542,25 +543,18 @@ WebViewInternal.prototype.handleBrowserPluginAttributeMutation =
this.browserPluginNode.removeAttribute('internalinstanceid');
this.internalInstanceId = parseInt(newValue);
- if (!this.deferredAttachState) {
- this.parseAttributes();
- return;
- }
-
if (!!this.guestInstanceId && this.guestInstanceId != 0) {
- window.setTimeout(function() {
- var isNewWindow = this.deferredAttachState ?
- this.deferredAttachState.isNewWindow : false;
- var params = this.buildAttachParams(isNewWindow);
- guestViewInternalNatives.AttachGuest(
- this.internalInstanceId,
- this.guestInstanceId,
- params,
- function(w) {
- this.contentWindow = w;
- }.bind(this)
- );
- }.bind(this), 0);
+ var isNewWindow = this.deferredAttachState ?
+ this.deferredAttachState.isNewWindow : false;
+ var params = this.buildAttachParams(isNewWindow);
+ guestViewInternalNatives.AttachGuest(
+ this.internalInstanceId,
+ this.guestInstanceId,
+ params,
+ function(w) {
+ this.contentWindow = w;
+ }.bind(this)
+ );
}
return;
@@ -703,10 +697,6 @@ WebViewInternal.prototype.onFrameNameChanged = function(name) {
}
};
-WebViewInternal.prototype.onPluginDestroyed = function() {
- this.reset();
-};
-
WebViewInternal.prototype.dispatchEvent = function(webViewEvent) {
return this.webviewNode.dispatchEvent(webViewEvent);
};

Powered by Google App Engine
This is Rietveld 408576698