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

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

Issue 12224094: Browser Plugin: Navigating to the same URL after crash should load a new guest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits + Merged with ToT Created 7 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index 73f4f1af30fd11ea1ec80dd466bb55b15eb1b0c0..f7b52f07f969de6665a1ee9d1eda8045ca9acb71 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -156,8 +156,17 @@ WebView.prototype.handleObjectMutation_ = function(mutation) {
this.node_.removeAttribute(mutation.attributeName);
} else {
// Update the <webview> attribute to match the BrowserPlugin attribute.
- this.node_.setAttribute(mutation.attributeName,
- this.objectNode_.getAttribute(mutation.attributeName));
+ // Note: Calling setAttribute on <webview> will trigger its mutation
+ // observer which will then propagate that attribute to BrowserPlugin. In
+ // cases where we permit assigning a BrowserPlugin attribute the same value
+ // again (such as navigation when crashed), this could end up in an infinite
+ // loop. Thus, we avoid this loop by only updating the <webview> attribute
+ // if the BrowserPlugin attributes differs from it.
+ var oldValue = this.node_.getAttribute(mutation.attributeName);
+ var newValue = this.objectNode_.getAttribute(mutation.attributeName);
+ if (newValue != oldValue) {
+ this.node_.setAttribute(mutation.attributeName, newValue);
+ }
}
};
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698