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

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

Issue 1033373003: GuestView: Lazily push attributes to the browser process on attach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_sizing
Patch Set: Removed more unnecessary changes 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/resources/guest_view/guest_view_attributes.js ('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/web_view/web_view.js
diff --git a/extensions/renderer/resources/guest_view/web_view/web_view.js b/extensions/renderer/resources/guest_view/web_view/web_view.js
index 1b40d156f2ef994b235fb4ed3f581d6d8aafa698..d1d367769a13f69ace45ac0717029eaa91edad3b 100644
--- a/extensions/renderer/resources/guest_view/web_view/web_view.js
+++ b/extensions/renderer/resources/guest_view/web_view/web_view.js
@@ -55,6 +55,10 @@ WebViewImpl.setupElement = function(proto) {
// Initiates navigation once the <webview> element is attached to the DOM.
WebViewImpl.prototype.onElementAttached = function() {
+ // Mark all attributes as dirty on attachment.
+ for (var i in this.attributes) {
+ this.attributes[i].dirty = true;
+ }
for (var i in this.attributes) {
this.attributes[i].attach();
}
@@ -64,6 +68,9 @@ WebViewImpl.prototype.onElementAttached = function() {
WebViewImpl.prototype.onElementDetached = function() {
this.guest.destroy();
for (var i in this.attributes) {
+ this.attributes[i].dirty = false;
+ }
+ for (var i in this.attributes) {
this.attributes[i].detach();
}
};
@@ -167,7 +174,9 @@ WebViewImpl.prototype.onAttach = function(storagePartitionId) {
WebViewImpl.prototype.buildContainerParams = function() {
var params = { 'userAgentOverride': this.userAgentOverride };
for (var i in this.attributes) {
- params[i] = this.attributes[i].getValue();
+ var value = this.attributes[i].getValueIfDirty();
+ if (value)
+ params[i] = value;
}
return params;
};
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view_attributes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698