summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/resources/extensions/web_view.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/resources/extensions/web_view.js')
-rw-r--r--chrome/renderer/resources/extensions/web_view.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index 52126d4..c0f4324 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -18,6 +18,8 @@ var WEB_VIEW_EVENTS = {
'sizechanged': ['oldHeight', 'oldWidth', 'newHeight', 'newWidth'],
};
+var webViewInstanceIdCounter = 0;
+
var createEvent = function(name) {
var eventOpts = {supportsListeners: true, supportsFilters: true};
return new eventBindings.Event(name, undefined, eventOpts);
@@ -343,11 +345,13 @@ WebView.prototype.handleBrowserPluginAttributeMutation_ = function(mutation) {
*/
WebView.prototype.setupWebviewNodeEvents_ = function() {
var self = this;
+ this.viewInstanceId_ = ++webViewInstanceIdCounter;
var onInstanceIdAllocated = function(e) {
var detail = e.detail ? JSON.parse(e.detail) : {};
self.instanceId_ = detail.windowId;
var params = {
- 'api': 'webview'
+ 'api': 'webview',
+ 'instanceId': self.viewInstanceId_
};
self.browserPluginNode_['-internal-attach'](params);