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

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: Fixed nit 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..7187089b371c112eed89b24a005f09f7e79c979c 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.
+ var self = this;
WEB_VIEW_API_METHODS.forEach(function(apiMethod) {
- node[apiMethod] = this.objectNode_[apiMethod].bind(this.objectNode_);
+ 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