diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-10-28 14:43:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-28 21:44:52 +0000 |
commit | 83a4b3aa72d98fe4176b4a54c8cea227ed966570 (patch) | |
tree | b945cea0a7bd5e5b25a3ff9a6a8be834adf0b84b /extensions/renderer/resources | |
parent | 6d9425ec7badda912555d46ea7abcfab81fdd9b9 (diff) | |
download | chromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.zip chromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.tar.gz chromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.tar.bz2 |
[Extensions] Don't allow built-in extensions code to be overridden
BUG=546677
Review URL: https://codereview.chromium.org/1417513003
Cr-Commit-Position: refs/heads/master@{#356654}
Diffstat (limited to 'extensions/renderer/resources')
48 files changed, 101 insertions, 98 deletions
diff --git a/extensions/renderer/resources/app_runtime_custom_bindings.js b/extensions/renderer/resources/app_runtime_custom_bindings.js index 2b492c5..0364b66 100644 --- a/extensions/renderer/resources/app_runtime_custom_bindings.js +++ b/extensions/renderer/resources/app_runtime_custom_bindings.js @@ -71,4 +71,4 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched', } }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/app_window_custom_bindings.js b/extensions/renderer/resources/app_window_custom_bindings.js index cb44642..63f1eae 100644 --- a/extensions/renderer/resources/app_window_custom_bindings.js +++ b/extensions/renderer/resources/app_window_custom_bindings.js @@ -404,7 +404,7 @@ function updateSizeConstraints(boundsType, constraints) { currentWindowInternal.setSizeConstraints(boundsType, constraints); } -exports.binding = appWindow.generate(); -exports.onAppWindowClosed = onAppWindowClosed; -exports.updateAppWindowProperties = updateAppWindowProperties; -exports.appWindowShownForTests = onAppWindowShownForTests; +exports.$set('binding', appWindow.generate()); +exports.$set('onAppWindowClosed', onAppWindowClosed); +exports.$set('updateAppWindowProperties', updateAppWindowProperties); +exports.$set('appWindowShownForTests', onAppWindowShownForTests); diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js index cf671cb..d40b18f 100644 --- a/extensions/renderer/resources/binding.js +++ b/extensions/renderer/resources/binding.js @@ -524,4 +524,4 @@ Binding.prototype = { } }; -exports.Binding = Binding; +exports.$set('Binding', Binding); diff --git a/extensions/renderer/resources/browser_test_environment_specific_bindings.js b/extensions/renderer/resources/browser_test_environment_specific_bindings.js index f540862..8574068 100644 --- a/extensions/renderer/resources/browser_test_environment_specific_bindings.js +++ b/extensions/renderer/resources/browser_test_environment_specific_bindings.js @@ -11,5 +11,5 @@ function testDone(runNextTest) { setTimeout(runNextTest, 0); } -exports.registerHooks = registerHooks; -exports.testDone = testDone; +exports.$set('registerHooks', registerHooks); +exports.$set('testDone', testDone); diff --git a/extensions/renderer/resources/context_menus_custom_bindings.js b/extensions/renderer/resources/context_menus_custom_bindings.js index fe5cec9..ec8080f 100644 --- a/extensions/renderer/resources/context_menus_custom_bindings.js +++ b/extensions/renderer/resources/context_menus_custom_bindings.js @@ -23,4 +23,4 @@ binding.registerCustomHook(function(bindingsAPI) { apiFunctions.setCustomCallback('removeAll', handlers.callbacks.removeAll); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/context_menus_handlers.js b/extensions/renderer/resources/context_menus_handlers.js index b334900..aef6889 100644 --- a/extensions/renderer/resources/context_menus_handlers.js +++ b/extensions/renderer/resources/context_menus_handlers.js @@ -138,4 +138,4 @@ function createContextMenusHandlers(isWebview) { }; } -exports.create = createContextMenusHandlers; +exports.$set('create', createContextMenusHandlers); diff --git a/extensions/renderer/resources/declarative_webrequest_custom_bindings.js b/extensions/renderer/resources/declarative_webrequest_custom_bindings.js index 641b782..e9da12b 100644 --- a/extensions/renderer/resources/declarative_webrequest_custom_bindings.js +++ b/extensions/renderer/resources/declarative_webrequest_custom_bindings.js @@ -93,4 +93,4 @@ binding.registerCustomHook(function(api) { }; }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/entry_id_manager.js b/extensions/renderer/resources/entry_id_manager.js index 9fc2c14..8e23942 100644 --- a/extensions/renderer/resources/entry_id_manager.js +++ b/extensions/renderer/resources/entry_id_manager.js @@ -47,6 +47,6 @@ function getEntryById(id) { return idsToEntries[id]; } -exports.registerEntry = registerEntry; -exports.getEntryId = getEntryId; -exports.getEntryById = getEntryById; +exports.$set('registerEntry', registerEntry); +exports.$set('getEntryId', getEntryId); +exports.$set('getEntryById', getEntryById); diff --git a/extensions/renderer/resources/event.js b/extensions/renderer/resources/event.js index bb71297..5f0b912 100644 --- a/extensions/renderer/resources/event.js +++ b/extensions/renderer/resources/event.js @@ -503,8 +503,8 @@ ] }); // NOTE: Event is (lazily) exposed as chrome.Event from dispatcher.cc. - exports.Event = Event; + exports.$set('Event', Event); - exports.dispatchEvent = dispatchEvent; - exports.parseEventOptions = parseEventOptions; - exports.registerArgumentMassager = registerArgumentMassager; + exports.$set('dispatchEvent', dispatchEvent); + exports.$set('parseEventOptions', parseEventOptions); + exports.$set('registerArgumentMassager', registerArgumentMassager); diff --git a/extensions/renderer/resources/extension_custom_bindings.js b/extensions/renderer/resources/extension_custom_bindings.js index 155b762..68450d5 100644 --- a/extensions/renderer/resources/extension_custom_bindings.js +++ b/extensions/renderer/resources/extension_custom_bindings.js @@ -108,4 +108,4 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) { } }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/guest_view/extension_options/extension_options.js b/extensions/renderer/resources/guest_view/extension_options/extension_options.js index 7193607..70e1158 100644 --- a/extensions/renderer/resources/guest_view/extension_options/extension_options.js +++ b/extensions/renderer/resources/guest_view/extension_options/extension_options.js @@ -49,4 +49,4 @@ ExtensionOptionsImpl.prototype.createGuest = function() { GuestViewContainer.registerElement(ExtensionOptionsImpl); // Exports. -exports.ExtensionOptionsImpl = ExtensionOptionsImpl; +exports.$set('ExtensionOptionsImpl', ExtensionOptionsImpl); diff --git a/extensions/renderer/resources/guest_view/extension_options/extension_options_constants.js b/extensions/renderer/resources/guest_view/extension_options/extension_options_constants.js index f9b29ae..c4d9692 100644 --- a/extensions/renderer/resources/guest_view/extension_options/extension_options_constants.js +++ b/extensions/renderer/resources/guest_view/extension_options/extension_options_constants.js @@ -10,4 +10,5 @@ var ExtensionOptionsConstants = { ATTRIBUTE_EXTENSION: 'extension' }; -exports.ExtensionOptionsConstants = $Object.freeze(ExtensionOptionsConstants); +exports.$set('ExtensionOptionsConstants', + $Object.freeze(ExtensionOptionsConstants)); diff --git a/extensions/renderer/resources/guest_view/extension_options/extension_options_events.js b/extensions/renderer/resources/guest_view/extension_options/extension_options_events.js index 590d48a..20a2f1f 100644 --- a/extensions/renderer/resources/guest_view/extension_options/extension_options_events.js +++ b/extensions/renderer/resources/guest_view/extension_options/extension_options_events.js @@ -37,4 +37,4 @@ ExtensionOptionsEvents.prototype.getEvents = function() { }; // Exports. -exports.ExtensionOptionsEvents = ExtensionOptionsEvents; +exports.$set('ExtensionOptionsEvents', ExtensionOptionsEvents); diff --git a/extensions/renderer/resources/guest_view/extension_view/extension_view.js b/extensions/renderer/resources/guest_view/extension_view/extension_view.js index 7858e81..763b554 100644 --- a/extensions/renderer/resources/guest_view/extension_view/extension_view.js +++ b/extensions/renderer/resources/guest_view/extension_view/extension_view.js @@ -136,4 +136,4 @@ ExtensionViewImpl.prototype.loadNextSrc = function() { GuestViewContainer.registerElement(ExtensionViewImpl); // Exports. -exports.ExtensionViewImpl = ExtensionViewImpl; +exports.$set('ExtensionViewImpl', ExtensionViewImpl); diff --git a/extensions/renderer/resources/guest_view/extension_view/extension_view_constants.js b/extensions/renderer/resources/guest_view/extension_view/extension_view_constants.js index b8f0969..80934cf 100644 --- a/extensions/renderer/resources/guest_view/extension_view/extension_view_constants.js +++ b/extensions/renderer/resources/guest_view/extension_view/extension_view_constants.js @@ -11,4 +11,4 @@ var ExtensionViewConstants = { ATTRIBUTE_SRC: 'src', }; -exports.ExtensionViewConstants = $Object.freeze(ExtensionViewConstants); +exports.$set('ExtensionViewConstants', $Object.freeze(ExtensionViewConstants)); diff --git a/extensions/renderer/resources/guest_view/extension_view/extension_view_events.js b/extensions/renderer/resources/guest_view/extension_view/extension_view_events.js index 901085b..db67418 100644 --- a/extensions/renderer/resources/guest_view/extension_view/extension_view_events.js +++ b/extensions/renderer/resources/guest_view/extension_view/extension_view_events.js @@ -29,4 +29,4 @@ ExtensionViewEvents.prototype.handleLoadCommitEvent = function(event) { this.view.onLoadCommit(event.url); }; -exports.ExtensionViewEvents = ExtensionViewEvents; +exports.$set('ExtensionViewEvents', ExtensionViewEvents); diff --git a/extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js b/extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js index a87ee76..07c6dde 100644 --- a/extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js +++ b/extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js @@ -2,5 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -exports.ExtensionViewInternal = - require('binding').Binding.create('extensionViewInternal').generate(); +exports.$set( + 'ExtensionViewInternal', + require('binding').Binding.create('extensionViewInternal').generate()); diff --git a/extensions/renderer/resources/guest_view/guest_view.js b/extensions/renderer/resources/guest_view/guest_view.js index 66d48a2..1f887a7 100644 --- a/extensions/renderer/resources/guest_view/guest_view.js +++ b/extensions/renderer/resources/guest_view/guest_view.js @@ -350,6 +350,6 @@ GuestView.prototype.getId = function() { }; // Exports -exports.GuestView = GuestView; -exports.GuestViewImpl = GuestViewImpl; -exports.ResizeEvent = ResizeEvent; +exports.$set('GuestView', GuestView); +exports.$set('GuestViewImpl', GuestViewImpl); +exports.$set('ResizeEvent', ResizeEvent); diff --git a/extensions/renderer/resources/guest_view/guest_view_attributes.js b/extensions/renderer/resources/guest_view/guest_view_attributes.js index 7bc33b8..6c7f711 100644 --- a/extensions/renderer/resources/guest_view/guest_view_attributes.js +++ b/extensions/renderer/resources/guest_view/guest_view_attributes.js @@ -139,4 +139,4 @@ var GuestViewAttributes = { }; // Exports. -exports.GuestViewAttributes = GuestViewAttributes; +exports.$set('GuestViewAttributes', GuestViewAttributes); diff --git a/extensions/renderer/resources/guest_view/guest_view_container.js b/extensions/renderer/resources/guest_view/guest_view_container.js index 3e471d4..5e1aac9 100644 --- a/extensions/renderer/resources/guest_view/guest_view_container.js +++ b/extensions/renderer/resources/guest_view/guest_view_container.js @@ -306,4 +306,4 @@ function registerGuestViewElement(guestViewContainerType) { } // Exports. -exports.GuestViewContainer = GuestViewContainer; +exports.$set('GuestViewContainer', GuestViewContainer); diff --git a/extensions/renderer/resources/guest_view/guest_view_events.js b/extensions/renderer/resources/guest_view/guest_view_events.js index fda0db1..e3ccde1 100644 --- a/extensions/renderer/resources/guest_view/guest_view_events.js +++ b/extensions/renderer/resources/guest_view/guest_view_events.js @@ -174,5 +174,5 @@ GuestViewEvents.prototype.weakWrapper = function(func) { GuestViewEvents.prototype.getEvents = function() { return {}; }; // Exports. -exports.GuestViewEvents = GuestViewEvents; -exports.CreateEvent = CreateEvent; +exports.$set('GuestViewEvents', GuestViewEvents); +exports.$set('CreateEvent', CreateEvent); 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 6fcf028..6dd4fae 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view.js @@ -223,4 +223,4 @@ WebViewImpl.prototype.maybeSetupContextMenus = function() {}; GuestViewContainer.registerElement(WebViewImpl); // Exports. -exports.WebViewImpl = WebViewImpl; +exports.$set('WebViewImpl', WebViewImpl); diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js b/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js index c3cc28e..5f4bf2c 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js @@ -293,4 +293,4 @@ var WebViewActionRequests = { }; // Exports. -exports.WebViewActionRequests = WebViewActionRequests; +exports.$set('WebViewActionRequests', WebViewActionRequests); diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_constants.js b/extensions/renderer/resources/guest_view/web_view/web_view_constants.js index 528a6fc..09110e1 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view_constants.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view_constants.js @@ -37,4 +37,4 @@ var WebViewConstants = { 'The permission request for "%1" has been denied.' }; -exports.WebViewConstants = $Object.freeze(WebViewConstants); +exports.$set('WebViewConstants', $Object.freeze(WebViewConstants)); diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_events.js b/extensions/renderer/resources/guest_view/web_view/web_view_events.js index 6dbb16b..1077684 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view_events.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view_events.js @@ -298,4 +298,4 @@ function DeclarativeWebRequestEvent(opt_eventName, DeclarativeWebRequestEvent.prototype.__proto__ = EventBindings.Event.prototype; // Exports. -exports.WebViewEvents = WebViewEvents; +exports.$set('WebViewEvents', WebViewEvents); diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_internal.js b/extensions/renderer/resources/guest_view/web_view/web_view_internal.js index 03ede9bc..4d2c36c 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view_internal.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view_internal.js @@ -2,5 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -exports.WebViewInternal = - require('binding').Binding.create('webViewInternal').generate(); +exports.$set( + 'WebViewInternal', + require('binding').Binding.create('webViewInternal').generate()); diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js b/extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js index 62f7459..61b553b 100644 --- a/extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js +++ b/extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js @@ -52,4 +52,4 @@ binding.registerCustomHook(function(api) { } }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/i18n_custom_bindings.js b/extensions/renderer/resources/i18n_custom_bindings.js index 4ee5206..de69fa2 100644 --- a/extensions/renderer/resources/i18n_custom_bindings.js +++ b/extensions/renderer/resources/i18n_custom_bindings.js @@ -46,4 +46,4 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) { }); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/image_util.js b/extensions/renderer/resources/image_util.js index b6cd1b1..a7a27a6 100644 --- a/extensions/renderer/resources/image_util.js +++ b/extensions/renderer/resources/image_util.js @@ -78,5 +78,5 @@ function loadAllImages(imageSpecs, callbacks) { } } -exports.loadImageData = loadImageData; -exports.loadAllImages = loadAllImages; +exports.$set('loadImageData', loadImageData); +exports.$set('loadAllImages', loadAllImages); diff --git a/extensions/renderer/resources/json_schema.js b/extensions/renderer/resources/json_schema.js index 147dd67..135b0ee 100644 --- a/extensions/renderer/resources/json_schema.js +++ b/extensions/renderer/resources/json_schema.js @@ -522,4 +522,4 @@ JSONSchemaValidator.prototype.resetErrors = function() { this.errors = []; }; -exports.JSONSchemaValidator = JSONSchemaValidator; +exports.$set('JSONSchemaValidator', JSONSchemaValidator); diff --git a/extensions/renderer/resources/last_error.js b/extensions/renderer/resources/last_error.js index 9b5b3c0..a205ab3 100644 --- a/extensions/renderer/resources/last_error.js +++ b/extensions/renderer/resources/last_error.js @@ -134,9 +134,9 @@ function reportIfUnchecked(name, targetChrome, stack) { (name || "unknown") + ": " + message + (stack ? "\n" + stack : "")); } -exports.clear = clear; -exports.hasAccessed = hasAccessed; -exports.hasError = hasError; -exports.set = set; -exports.run = run; -exports.reportIfUnchecked = reportIfUnchecked; +exports.$set('clear', clear); +exports.$set('hasAccessed', hasAccessed); +exports.$set('hasError', hasError); +exports.$set('set', set); +exports.$set('run', run); +exports.$set('reportIfUnchecked', reportIfUnchecked); diff --git a/extensions/renderer/resources/messaging.js b/extensions/renderer/resources/messaging.js index 5fe9920..5a7ec1e 100644 --- a/extensions/renderer/resources/messaging.js +++ b/extensions/renderer/resources/messaging.js @@ -377,16 +377,16 @@ var Port = utils.expose('Port', PortImpl, { functions: [ 'onMessage' ] }); -exports.kRequestChannel = kRequestChannel; -exports.kMessageChannel = kMessageChannel; -exports.kNativeMessageChannel = kNativeMessageChannel; -exports.Port = Port; -exports.createPort = createPort; -exports.sendMessageImpl = sendMessageImpl; -exports.sendMessageUpdateArguments = sendMessageUpdateArguments; +exports.$set('kRequestChannel', kRequestChannel); +exports.$set('kMessageChannel', kMessageChannel); +exports.$set('kNativeMessageChannel', kNativeMessageChannel); +exports.$set('Port', Port); +exports.$set('createPort', createPort); +exports.$set('sendMessageImpl', sendMessageImpl); +exports.$set('sendMessageUpdateArguments', sendMessageUpdateArguments); // For C++ code to call. -exports.hasPort = hasPort; -exports.dispatchOnConnect = dispatchOnConnect; -exports.dispatchOnDisconnect = dispatchOnDisconnect; -exports.dispatchOnMessage = dispatchOnMessage; +exports.$set('hasPort', hasPort); +exports.$set('dispatchOnConnect', dispatchOnConnect); +exports.$set('dispatchOnDisconnect', dispatchOnDisconnect); +exports.$set('dispatchOnMessage', dispatchOnMessage); diff --git a/extensions/renderer/resources/messaging_utils.js b/extensions/renderer/resources/messaging_utils.js index d1b563d..381fbeb 100644 --- a/extensions/renderer/resources/messaging_utils.js +++ b/extensions/renderer/resources/messaging_utils.js @@ -50,4 +50,4 @@ function alignSendMessageArguments(args, hasOptionsArgument) { return [targetId, request, responseCallback]; } -exports.alignSendMessageArguments = alignSendMessageArguments; +exports.$set('alignSendMessageArguments', alignSendMessageArguments); diff --git a/extensions/renderer/resources/mime_handler_private_custom_bindings.js b/extensions/renderer/resources/mime_handler_private_custom_bindings.js index 83a41af..bd7eddd 100644 --- a/extensions/renderer/resources/mime_handler_private_custom_bindings.js +++ b/extensions/renderer/resources/mime_handler_private_custom_bindings.js @@ -72,4 +72,4 @@ binding.registerCustomHook(function(bindingsAPI) { }); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/mojo_private_custom_bindings.js b/extensions/renderer/resources/mojo_private_custom_bindings.js index f898c07..18d6016 100644 --- a/extensions/renderer/resources/mojo_private_custom_bindings.js +++ b/extensions/renderer/resources/mojo_private_custom_bindings.js @@ -20,4 +20,4 @@ binding.registerCustomHook(function(bindingsAPI) { }); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/permissions_custom_bindings.js b/extensions/renderer/resources/permissions_custom_bindings.js index 43b436e..492360a 100644 --- a/extensions/renderer/resources/permissions_custom_bindings.js +++ b/extensions/renderer/resources/permissions_custom_bindings.js @@ -89,4 +89,4 @@ binding.registerCustomHook(function(api) { permissions.onAdded.dispatchToListener; }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/printer_provider_custom_bindings.js b/extensions/renderer/resources/printer_provider_custom_bindings.js index 061029b..4bf6f12 100644 --- a/extensions/renderer/resources/printer_provider_custom_bindings.js +++ b/extensions/renderer/resources/printer_provider_custom_bindings.js @@ -120,4 +120,4 @@ handleEvent('onGetUsbPrinterInfoRequested', function(args, callback) { callback(true); }, printerProviderInternal.reportUsbPrinterInfo); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/runtime_custom_bindings.js b/extensions/renderer/resources/runtime_custom_bindings.js index 2b0e44a..1f829d4 100644 --- a/extensions/renderer/resources/runtime_custom_bindings.js +++ b/extensions/renderer/resources/runtime_custom_bindings.js @@ -202,5 +202,5 @@ binding.registerCustomHook(function(binding, id, contextType) { bindDirectoryEntryCallback('getPackageDirectoryEntry', apiFunctions); }); -exports.bindDirectoryEntryCallback = bindDirectoryEntryCallback; -exports.binding = binding.generate(); +exports.$set('bindDirectoryEntryCallback', bindDirectoryEntryCallback); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/schema_utils.js b/extensions/renderer/resources/schema_utils.js index 3d7e929..f778275 100644 --- a/extensions/renderer/resources/schema_utils.js +++ b/extensions/renderer/resources/schema_utils.js @@ -153,7 +153,7 @@ function isFunctionSignatureAmbiguous(functionDef) { return false; }; -exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous; -exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate; -exports.schemaValidator = schemaValidator; -exports.validate = validate; +exports.$set('isFunctionSignatureAmbiguous', isFunctionSignatureAmbiguous); +exports.$set('normalizeArgumentsAndValidate', normalizeArgumentsAndValidate); +exports.$set('schemaValidator', schemaValidator); +exports.$set('validate', validate); diff --git a/extensions/renderer/resources/send_request.js b/extensions/renderer/resources/send_request.js index 3dc523c..1692aaa 100644 --- a/extensions/renderer/resources/send_request.js +++ b/extensions/renderer/resources/send_request.js @@ -140,10 +140,10 @@ function clearCalledSendRequest() { calledSendRequest = false; } -exports.sendRequest = sendRequest; -exports.getCalledSendRequest = getCalledSendRequest; -exports.clearCalledSendRequest = clearCalledSendRequest; -exports.safeCallbackApply = safeCallbackApply; +exports.$set('sendRequest', sendRequest); +exports.$set('getCalledSendRequest', getCalledSendRequest); +exports.$set('clearCalledSendRequest', clearCalledSendRequest); +exports.$set('safeCallbackApply', safeCallbackApply); // Called by C++. -exports.handleResponse = handleResponse; +exports.$set('handleResponse', handleResponse); diff --git a/extensions/renderer/resources/serial_custom_bindings.js b/extensions/renderer/resources/serial_custom_bindings.js index 20d669a..d77631c 100644 --- a/extensions/renderer/resources/serial_custom_bindings.js +++ b/extensions/renderer/resources/serial_custom_bindings.js @@ -114,4 +114,4 @@ binding.registerCustomHook(function(bindingsAPI) { }); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/set_icon.js b/extensions/renderer/resources/set_icon.js index 83f5a80..5b66d6b 100644 --- a/extensions/renderer/resources/set_icon.js +++ b/extensions/renderer/resources/set_icon.js @@ -133,4 +133,4 @@ function setIcon(details, callback) { throw new Error('Either the path or imageData property must be specified.'); } -exports.setIcon = setIcon; +exports.$set('setIcon', setIcon); diff --git a/extensions/renderer/resources/storage_area.js b/extensions/renderer/resources/storage_area.js index de737ab..b5353ae 100644 --- a/extensions/renderer/resources/storage_area.js +++ b/extensions/renderer/resources/storage_area.js @@ -37,4 +37,4 @@ function StorageArea(namespace, schema) { $Array.forEach(apiFunctions, bindApiFunction); } -exports.StorageArea = StorageArea; +exports.$set('StorageArea', StorageArea); diff --git a/extensions/renderer/resources/test_custom_bindings.js b/extensions/renderer/resources/test_custom_bindings.js index 7310f06..6538efa 100644 --- a/extensions/renderer/resources/test_custom_bindings.js +++ b/extensions/renderer/resources/test_custom_bindings.js @@ -361,4 +361,4 @@ binding.registerCustomHook(function(api) { environmentSpecificBindings.registerHooks(api); }); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/uncaught_exception_handler.js b/extensions/renderer/resources/uncaught_exception_handler.js index f87efbc..de4d71e 100644 --- a/extensions/renderer/resources/uncaught_exception_handler.js +++ b/extensions/renderer/resources/uncaught_exception_handler.js @@ -95,16 +95,16 @@ function safeErrorToString(e, omitType) { * @param {string=} priorStackTrace - Error message suffix. * @see formatErrorMessage */ -exports.handle = function(message, e, priorStackTrace) { +exports.$set('handle', function(message, e, priorStackTrace) { message = formatErrorMessage(message, e, priorStackTrace); handler(message, e); -}; +}); // |newHandler| A function which matches |handler|. -exports.setHandler = function(newHandler) { +exports.$set('setHandler', function(newHandler) { handler = newHandler; -}; +}); -exports.getStackTrace = getStackTrace; -exports.getExtensionStackTrace = getExtensionStackTrace; -exports.safeErrorToString = safeErrorToString; +exports.$set('getStackTrace', getStackTrace); +exports.$set('getExtensionStackTrace', getExtensionStackTrace); +exports.$set('safeErrorToString', safeErrorToString); diff --git a/extensions/renderer/resources/utils.js b/extensions/renderer/resources/utils.js index ba14e8d..66094b90 100644 --- a/extensions/renderer/resources/utils.js +++ b/extensions/renderer/resources/utils.js @@ -166,9 +166,9 @@ function promise(func) { }); } -exports.forEach = forEach; -exports.loadTypeSchema = loadTypeSchema; -exports.lookup = lookup; -exports.expose = expose; -exports.deepCopy = deepCopy; -exports.promise = promise; +exports.$set('forEach', forEach); +exports.$set('loadTypeSchema', loadTypeSchema); +exports.$set('lookup', lookup); +exports.$set('expose', expose); +exports.$set('deepCopy', deepCopy); +exports.$set('promise', promise); diff --git a/extensions/renderer/resources/web_request_custom_bindings.js b/extensions/renderer/resources/web_request_custom_bindings.js index 045fe96..2dd7ce4 100644 --- a/extensions/renderer/resources/web_request_custom_bindings.js +++ b/extensions/renderer/resources/web_request_custom_bindings.js @@ -20,4 +20,4 @@ binding.registerCustomHook(function(api) { binding.registerCustomEvent(WebRequestEvent); -exports.binding = binding.generate(); +exports.$set('binding', binding.generate()); diff --git a/extensions/renderer/resources/web_request_internal_custom_bindings.js b/extensions/renderer/resources/web_request_internal_custom_bindings.js index 76460ee..7c9e279 100644 --- a/extensions/renderer/resources/web_request_internal_custom_bindings.js +++ b/extensions/renderer/resources/web_request_internal_custom_bindings.js @@ -188,5 +188,5 @@ var WebRequestEvent = utils.expose('WebRequestEvent', ] }); webRequestInternal = binding.generate(); -exports.binding = webRequestInternal; -exports.WebRequestEvent = WebRequestEvent; +exports.$set('binding', webRequestInternal); +exports.$set('WebRequestEvent', WebRequestEvent); |