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

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

Issue 11820029: <webview>: BrowserPlugin methods are not defined immediately after the shadow object is appended to… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | no next file » | 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 f52429ad87fbecc3dd8a2a49a9bb66c7d749f199..d2f703729bf7e815a4a0c23e4d56f965dcedf2c6 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -58,10 +58,13 @@ function WebView(node) {
shadowRoot.appendChild(this.objectNode_);
- // this.objectNode_[apiMethod] are defined after the shadow object is appended
- // to the shadow root.
+ // this.objectNode_[apiMethod] are not necessarily defined immediately after
+ // the shadow object is appended to the shadow root.
sadrul 2013/01/09 18:51:24 Interesting. Is this because of a race, or is that
Fady Samuel 2013/01/09 19:18:42 It works some of the time, so this is a race. This
WEB_VIEW_API_METHODS.forEach(function(apiMethod) {
- node[apiMethod] = this.objectNode_[apiMethod].bind(this.objectNode_);
+ var self = this;
arv (Not doing code reviews) 2013/01/09 19:40:01 Move self out of inner function? var self = this;
Fady Samuel 2013/01/09 19:49:25 Done.
+ node[apiMethod] = function(var_args) {
+ return self.objectNode_[apiMethod].apply(self.objectNode_, arguments);
+ };
}, this);
// Map attribute modifications on the <webview> tag to property changes in
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698