[Extensions] More bindings hardening

Revision 83a4b3aa72d98fe4176b4a54c8cea227ed966570 missed a few
(c/r/resources/extensions).

BUG=468931
BUG=591164

Review URL: https://codereview.chromium.org/1840453002

Cr-Commit-Position: refs/heads/master@{#383541}
diff --git a/chrome/renderer/resources/extensions/app_custom_bindings.js b/chrome/renderer/resources/extensions/app_custom_bindings.js
index 79fcfd8..b91705fb9 100644
--- a/chrome/renderer/resources/extensions/app_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_custom_bindings.js
@@ -6,8 +6,8 @@
 
 var GetAvailability = requireNative('v8_context').GetAvailability;
 if (!GetAvailability('app').is_available) {
-  exports.binding = {};
-  exports.onInstallStateResponse = function(){};
+  exports.$set('binding', {});
+  exports.$set('onInstallStateResponse', function(){});
   return;
 }
 
@@ -70,5 +70,5 @@
 if (extensionId)
   app.installState = wrapForLogging(app.installState);
 
-exports.binding = app;
-exports.onInstallStateResponse = onInstallStateResponse;
+exports.$set('binding', app);
+exports.$set('onInstallStateResponse', onInstallStateResponse);
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index b13569d..ade163d 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -990,5 +990,5 @@
   AutomationRootNodeImpl.destroy(treeID);
 }
 
-exports.AutomationNode = AutomationNode;
-exports.AutomationRootNode = AutomationRootNode;
+exports.$set('AutomationNode', AutomationNode);
+exports.$set('AutomationRootNode', AutomationRootNode);
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js
index 82a1e6c..7321710 100644
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -324,11 +324,13 @@
   DestroyAccessibilityTree(id);
 });
 
-exports.binding = automation.generate();
-
+var binding = automation.generate();
 // Add additional accessibility bindings not specified in the automation IDL.
 // Accessibility and automation share some APIs (see
 // ui/accessibility/ax_enums.idl).
 forEach(schema, function(k, v) {
-  exports.binding[k] = v;
+  binding[k] = v;
 });
+
+exports.$set('binding', binding);
+
diff --git a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
index cc22bef..e9c3d57a 100644
--- a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
@@ -34,4 +34,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js b/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
index 8751071..6beb9b7 100644
--- a/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
@@ -17,4 +17,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js b/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
index 1047ed75..dbcf8be 100644
--- a/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
@@ -40,4 +40,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js b/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
index c83639c..b0f40a6 100644
--- a/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
@@ -15,4 +15,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js b/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
index dca8df60..d1389b6 100644
--- a/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
@@ -23,4 +23,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/certificate_provider_custom_bindings.js b/chrome/renderer/resources/extensions/certificate_provider_custom_bindings.js
index 6089677..9573a1ab 100644
--- a/chrome/renderer/resources/extensions/certificate_provider_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/certificate_provider_custom_bindings.js
@@ -78,4 +78,4 @@
 handleEvent('onSignDigestRequested',
             certificateProviderInternal.reportSignature);
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/chrome_direct_setting.js b/chrome/renderer/resources/extensions/chrome_direct_setting.js
index c2ac995..76a556d 100644
--- a/chrome/renderer/resources/extensions/chrome_direct_setting.js
+++ b/chrome/renderer/resources/extensions/chrome_direct_setting.js
@@ -41,5 +41,5 @@
                             '.onChange');
 };
 
-exports.ChromeDirectSetting = ChromeDirectSetting;
+exports.$set('ChromeDirectSetting', ChromeDirectSetting);
 
diff --git a/chrome/renderer/resources/extensions/chrome_setting.js b/chrome/renderer/resources/extensions/chrome_setting.js
index 8d6f29e..ef81148 100644
--- a/chrome/renderer/resources/extensions/chrome_setting.js
+++ b/chrome/renderer/resources/extensions/chrome_setting.js
@@ -39,4 +39,4 @@
   this.onChange = new Event('types.ChromeSetting.' + prefKey + '.onChange');
 };
 
-exports.ChromeSetting = ChromeSetting;
+exports.$set('ChromeSetting', ChromeSetting);
diff --git a/chrome/renderer/resources/extensions/content_setting.js b/chrome/renderer/resources/extensions/content_setting.js
index c76b74b..ef50464 100644
--- a/chrome/renderer/resources/extensions/content_setting.js
+++ b/chrome/renderer/resources/extensions/content_setting.js
@@ -48,4 +48,4 @@
   };
 }
 
-exports.ContentSetting = ContentSetting;
+exports.$set('ContentSetting', ContentSetting);
diff --git a/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js b/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js
index f6cd6053..7375457 100644
--- a/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js
@@ -73,4 +73,4 @@
   };
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/desktop_capture_custom_bindings.js b/chrome/renderer/resources/extensions/desktop_capture_custom_bindings.js
index 3176009..c49ade7 100644
--- a/chrome/renderer/resources/extensions/desktop_capture_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/desktop_capture_custom_bindings.js
@@ -44,4 +44,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/developer_private_custom_bindings.js b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
index 3c41a5e..66cc96d 100644
--- a/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
@@ -60,4 +60,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/downloads_custom_bindings.js b/chrome/renderer/resources/extensions/downloads_custom_bindings.js
index 88efbac..f91d75f 100644
--- a/chrome/renderer/resources/extensions/downloads_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/downloads_custom_bindings.js
@@ -63,4 +63,4 @@
     throw e;
   }
 });
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/enterprise_platform_keys/internal_api.js b/chrome/renderer/resources/extensions/enterprise_platform_keys/internal_api.js
index 97ff660..bea9e96 100644
--- a/chrome/renderer/resources/extensions/enterprise_platform_keys/internal_api.js
+++ b/chrome/renderer/resources/extensions/enterprise_platform_keys/internal_api.js
@@ -6,6 +6,6 @@
                   .Binding.create('enterprise.platformKeysInternal')
                   .generate();
 
-exports.getTokens = binding.getTokens;
-exports.generateKey = binding.generateKey;
-exports.sign = binding.sign;
+exports.$set('getTokens', binding.getTokens);
+exports.$set('generateKey', binding.generateKey);
+exports.$set('sign', binding.sign);
diff --git a/chrome/renderer/resources/extensions/enterprise_platform_keys_custom_bindings.js b/chrome/renderer/resources/extensions/enterprise_platform_keys_custom_bindings.js
index a81c9448..319fd1c 100644
--- a/chrome/renderer/resources/extensions/enterprise_platform_keys_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/enterprise_platform_keys_custom_bindings.js
@@ -29,4 +29,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js b/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
index ee576d9..131c559 100644
--- a/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
@@ -29,4 +29,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/file_browser_handler_custom_bindings.js b/chrome/renderer/resources/extensions/file_browser_handler_custom_bindings.js
index b19c29a..c852a67 100644
--- a/chrome/renderer/resources/extensions/file_browser_handler_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_browser_handler_custom_bindings.js
@@ -54,4 +54,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/file_entry_binding_util.js b/chrome/renderer/resources/extensions/file_entry_binding_util.js
index 17897269..a378fba 100644
--- a/chrome/renderer/resources/extensions/file_entry_binding_util.js
+++ b/chrome/renderer/resources/extensions/file_entry_binding_util.js
@@ -118,4 +118,4 @@
           entryIdManager: entryIdManager};
 }
 
-exports.getFileBindingsForApi = getFileBindingsForApi;
+exports.$set('getFileBindingsForApi', getFileBindingsForApi);
diff --git a/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js b/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js
index 40cc343..3cbc661b 100644
--- a/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js
@@ -205,4 +205,4 @@
   dispatch(args);
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/file_system_custom_bindings.js b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
index 9be1ae5..9588b63 100644
--- a/chrome/renderer/resources/extensions/file_system_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
@@ -114,5 +114,5 @@
   };
 });
 
-exports.bindFileEntryCallback = bindFileEntryCallback;
-exports.binding = binding.generate();
+exports.$set('bindFileEntryCallback', bindFileEntryCallback);
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js b/chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js
index d7dd005c..91a2718 100644
--- a/chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js
@@ -347,4 +347,4 @@
       dispatch([onSuccessCallback, onErrorCallback]);
     });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/gcm_custom_bindings.js b/chrome/renderer/resources/extensions/gcm_custom_bindings.js
index fa3e5e4..d4815ef1 100644
--- a/chrome/renderer/resources/extensions/gcm_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/gcm_custom_bindings.js
@@ -41,4 +41,4 @@
     });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/identity_custom_bindings.js b/chrome/renderer/resources/extensions/identity_custom_bindings.js
index f595df1..d670009f 100644
--- a/chrome/renderer/resources/extensions/identity_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/identity_custom_bindings.js
@@ -21,4 +21,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/image_writer_private_custom_bindings.js b/chrome/renderer/resources/extensions/image_writer_private_custom_bindings.js
index 5ca3200..a186fa11 100644
--- a/chrome/renderer/resources/extensions/image_writer_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/image_writer_private_custom_bindings.js
@@ -17,4 +17,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/input.ime_custom_bindings.js b/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
index 9f4d9acb..512c4e8 100644
--- a/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
@@ -57,4 +57,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/log_private_custom_bindings.js b/chrome/renderer/resources/extensions/log_private_custom_bindings.js
index ae209d07..fb6dc7a2 100644
--- a/chrome/renderer/resources/extensions/log_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/log_private_custom_bindings.js
@@ -22,5 +22,5 @@
 
 });
 
-exports.bindFileEntryCallback = bindFileEntryCallback;
-exports.binding = binding.generate();
+exports.$set('bindFileEntryCallback', bindFileEntryCallback);
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/media_galleries_custom_bindings.js b/chrome/renderer/resources/extensions/media_galleries_custom_bindings.js
index 4be13a5..f75802ff 100644
--- a/chrome/renderer/resources/extensions/media_galleries_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/media_galleries_custom_bindings.js
@@ -102,4 +102,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/notifications_custom_bindings.js b/chrome/renderer/resources/extensions/notifications_custom_bindings.js
index fc6b4425..4a61d36 100644
--- a/chrome/renderer/resources/extensions/notifications_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/notifications_custom_bindings.js
@@ -144,4 +144,4 @@
 
 binding.registerCustomHook(notificationsCustomHook);
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/notifications_test_util.js b/chrome/renderer/resources/extensions/notifications_test_util.js
index 85a30ee..35bf192 100644
--- a/chrome/renderer/resources/extensions/notifications_test_util.js
+++ b/chrome/renderer/resources/extensions/notifications_test_util.js
@@ -38,7 +38,9 @@
   }[library];
 }
 
-var exports = {};
+var exports = {
+  $set: function(k, v) { this.k = v; }
+};
 
 var $Array = {
   push: function (ary, val) {
diff --git a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
index 6e753a9..1d1ffc5 100644
--- a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
@@ -121,4 +121,4 @@
   dispatch([text, suggestCallback]);
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/page_action_custom_bindings.js b/chrome/renderer/resources/extensions/page_action_custom_bindings.js
index b4f92c6..6b189cc1 100644
--- a/chrome/renderer/resources/extensions/page_action_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/page_action_custom_bindings.js
@@ -19,4 +19,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/page_capture_custom_bindings.js b/chrome/renderer/resources/extensions/page_capture_custom_bindings.js
index fa1a544..a6590b4 100644
--- a/chrome/renderer/resources/extensions/page_capture_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/page_capture_custom_bindings.js
@@ -32,4 +32,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/platform_keys/get_public_key.js b/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
index af4a858..19025a3 100644
--- a/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
+++ b/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
@@ -64,4 +64,4 @@
       });
 }
 
-exports.getPublicKey = getPublicKey;
+exports.$set('getPublicKey', getPublicKey);
diff --git a/chrome/renderer/resources/extensions/platform_keys/internal_api.js b/chrome/renderer/resources/extensions/platform_keys/internal_api.js
index ec54433..04cd411d 100644
--- a/chrome/renderer/resources/extensions/platform_keys/internal_api.js
+++ b/chrome/renderer/resources/extensions/platform_keys/internal_api.js
@@ -6,6 +6,6 @@
                   .Binding.create('platformKeysInternal')
                   .generate();
 
-exports.selectClientCertificates = binding.selectClientCertificates;
-exports.sign = binding.sign;
-exports.getPublicKey = binding.getPublicKey;
+exports.$set('selectClientCertificates', binding.selectClientCertificates);
+exports.$set('sign', binding.sign);
+exports.$set('getPublicKey', binding.getPublicKey);
diff --git a/chrome/renderer/resources/extensions/platform_keys/key.js b/chrome/renderer/resources/extensions/platform_keys/key.js
index e46bbcb..ee29bf0 100644
--- a/chrome/renderer/resources/extensions/platform_keys/key.js
+++ b/chrome/renderer/resources/extensions/platform_keys/key.js
@@ -69,7 +69,7 @@
   return keyImpl.spki;
 }
 
-exports.Key = Key;
-exports.KeyType = KeyType;
-exports.KeyUsage = KeyUsage;
-exports.getSpki = getSpki;
+exports.$set('Key', Key);
+exports.$set('KeyType', KeyType);
+exports.$set('KeyUsage', KeyUsage);
+exports.$set('getSpki', getSpki);
diff --git a/chrome/renderer/resources/extensions/platform_keys/utils.js b/chrome/renderer/resources/extensions/platform_keys/utils.js
index 7bfbbf5..5fc45e5 100644
--- a/chrome/renderer/resources/extensions/platform_keys/utils.js
+++ b/chrome/renderer/resources/extensions/platform_keys/utils.js
@@ -13,4 +13,4 @@
   return result;
 };
 
-exports.intersect = intersect;
+exports.$set('intersect', intersect);
diff --git a/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
index 924e60ea..d2c00f8 100644
--- a/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
@@ -63,4 +63,4 @@
       });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js b/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
index 21d4d47..2150e38 100644
--- a/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
@@ -104,4 +104,4 @@
   dispatch([fileInfo]);
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/system_indicator_custom_bindings.js b/chrome/renderer/resources/extensions/system_indicator_custom_bindings.js
index e07a9cd..4b618f8 100644
--- a/chrome/renderer/resources/extensions/system_indicator_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/system_indicator_custom_bindings.js
@@ -21,4 +21,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js b/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
index 6019c69..e8d3254 100644
--- a/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
@@ -60,4 +60,4 @@
   apiFunctions.setCustomCallback('captureOffscreenTab', proxyToGetUserMedia);
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/tabs_custom_bindings.js b/chrome/renderer/resources/extensions/tabs_custom_bindings.js
index 0eb2946..019d463 100644
--- a/chrome/renderer/resources/extensions/tabs_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tabs_custom_bindings.js
@@ -53,4 +53,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/tag_watcher.js b/chrome/renderer/resources/extensions/tag_watcher.js
index 87deaf1..0566ab8 100644
--- a/chrome/renderer/resources/extensions/tag_watcher.js
+++ b/chrome/renderer/resources/extensions/tag_watcher.js
@@ -52,4 +52,4 @@
   }, useCapture);
 }
 
-exports.addTagWatcher = addTagWatcher;
+exports.$set('addTagWatcher', addTagWatcher);
diff --git a/chrome/renderer/resources/extensions/tts_custom_bindings.js b/chrome/renderer/resources/extensions/tts_custom_bindings.js
index 1fcea62f..0d5b3ad 100644
--- a/chrome/renderer/resources/extensions/tts_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tts_custom_bindings.js
@@ -54,4 +54,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js b/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
index 1a2c970..22e3f2c3 100644
--- a/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
@@ -19,4 +19,4 @@
   dispatch([text, options, sendTtsEvent]);
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/web_view/chrome_web_view_internal_custom_bindings.js b/chrome/renderer/resources/extensions/web_view/chrome_web_view_internal_custom_bindings.js
index 7b64824..8f159ad 100644
--- a/chrome/renderer/resources/extensions/web_view/chrome_web_view_internal_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/web_view/chrome_web_view_internal_custom_bindings.js
@@ -27,4 +27,4 @@
 
 });
 
-exports.ChromeWebView = binding.generate();
+exports.$set('ChromeWebView', binding.generate());
diff --git a/chrome/renderer/resources/extensions/webrtc_desktop_capture_private_custom_bindings.js b/chrome/renderer/resources/extensions/webrtc_desktop_capture_private_custom_bindings.js
index ce2fbf8..ef36c384 100644
--- a/chrome/renderer/resources/extensions/webrtc_desktop_capture_private_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/webrtc_desktop_capture_private_custom_bindings.js
@@ -39,4 +39,4 @@
   });
 });
 
-exports.binding = binding.generate();
+exports.$set('binding', binding.generate());
diff --git a/chrome/renderer/resources/extensions/webstore_custom_bindings.js b/chrome/renderer/resources/extensions/webstore_custom_bindings.js
index cd18215..89b11cc 100644
--- a/chrome/renderer/resources/extensions/webstore_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/webstore_custom_bindings.js
@@ -85,7 +85,7 @@
   onDownloadProgress: installer.onDownloadProgress
 };
 
-exports.binding = chromeWebstore;
+exports.$set('binding', chromeWebstore);
 
 // Called by webstore_bindings.cc.
 exports.onInstallResponse =