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

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

Issue 1915753002: Sanitize inheritance in callers of utils.expose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit: space after ':' Created 4 years, 8 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
Index: chrome/renderer/resources/extensions/web_view/chrome_web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view/chrome_web_view.js b/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
index abad16253e0727be18eaf94dec8c794c4558cdd2..bbea26b2d227ff0ba28f8c0f73d2d2b79e713455 100644
--- a/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
+++ b/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
@@ -37,11 +37,12 @@ function ContextMenusOnClickedEvent(webViewInstanceId,
opt_argSchemas,
opt_eventOptions) {
var subEventName = GetUniqueSubEventName(opt_eventName);
- EventBindings.Event.call(this,
- subEventName,
- opt_argSchemas,
- opt_eventOptions,
- webViewInstanceId);
+ $Function.call(EventBindings.Event,
+ this,
+ subEventName,
+ opt_argSchemas,
+ opt_eventOptions,
+ webViewInstanceId);
var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId);
if (!view) {
@@ -52,19 +53,21 @@ function ContextMenusOnClickedEvent(webViewInstanceId,
$Function.apply(this.dispatch, this, $Array.slice(arguments));
}.bind(this), {instanceId: webViewInstanceId});
}
+$Object.setPrototypeOf(ContextMenusOnClickedEvent.prototype,
+ EventBindings.Event.prototype);
-ContextMenusOnClickedEvent.prototype.__proto__ = EventBindings.Event.prototype;
-
+// This event is exposed as <webview>.contextMenus.onShow.
function ContextMenusOnContextMenuEvent(webViewInstanceId,
opt_eventName,
opt_argSchemas,
opt_eventOptions) {
var subEventName = GetUniqueSubEventName(opt_eventName);
- EventBindings.Event.call(this,
- subEventName,
- opt_argSchemas,
- opt_eventOptions,
- webViewInstanceId);
+ $Function.call(EventBindings.Event,
+ this,
+ subEventName,
+ opt_argSchemas,
+ opt_eventOptions,
+ webViewInstanceId);
var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId);
if (!view) {
@@ -91,8 +94,8 @@ function ContextMenusOnContextMenuEvent(webViewInstanceId,
}.bind(this), {instanceId: webViewInstanceId});
}
-ContextMenusOnContextMenuEvent.prototype.__proto__ =
- EventBindings.Event.prototype;
+$Object.setPrototypeOf(ContextMenusOnContextMenuEvent.prototype,
+ EventBindings.Event.prototype);
// -----------------------------------------------------------------------------
// WebViewContextMenusImpl object.
@@ -101,6 +104,7 @@ ContextMenusOnContextMenuEvent.prototype.__proto__ =
function WebViewContextMenusImpl(viewInstanceId) {
this.viewInstanceId_ = viewInstanceId;
}
+$Object.setPrototypeOf(WebViewContextMenusImpl.prototype, null);
WebViewContextMenusImpl.prototype.create = function() {
var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments));
@@ -188,8 +192,6 @@ WebViewImpl.prototype.maybeSetupContextMenus = function() {
}.bind(this);
// Expose <webview>.contextMenus object.
- // TODO(lazyboy): Add documentation for contextMenus:
- // http://crbug.com/470979.
$Object.defineProperty(
this.element,
'contextMenus',
« no previous file with comments | « chrome/renderer/resources/extensions/platform_keys/subtle_crypto.js ('k') | extensions/renderer/resources/event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698