Chromium Code Reviews| Index: chrome/renderer/resources/extensions/binding.js |
| diff --git a/chrome/renderer/resources/extensions/binding.js b/chrome/renderer/resources/extensions/binding.js |
| index 9fdb392e9aae13d9e6bee6836718a4ecaecd2efa..9e2725a0e2adae16215d284915388e29dae35778 100644 |
| --- a/chrome/renderer/resources/extensions/binding.js |
| +++ b/chrome/renderer/resources/extensions/binding.js |
| @@ -17,13 +17,15 @@ var schemaRegistry = requireNative('schema_registry'); |
| var schemaUtils = require('schemaUtils'); |
| var sendRequest = require('sendRequest').sendRequest; |
| var utils = require('utils'); |
| +var logActivity = requireNative('activityLogger').LogActivity; |
| // Stores the name and definition of each API function, with methods to |
| // modify their behaviour (such as a custom way to handle requests to the |
| // API, a custom callback, etc). |
| -function APIFunctions() { |
| +function APIFunctions(namespace) { |
| this.apiFunctions_ = {}; |
| this.unavailableApiFunctions_ = {}; |
| + this.namespace = namespace; |
| } |
| APIFunctions.prototype.register = function(apiName, apiFunction) { |
| @@ -48,7 +50,14 @@ APIFunctions.prototype.setHook_ = |
| APIFunctions.prototype.setHandleRequest = |
| function(apiName, customizedFunction) { |
| - return this.setHook_(apiName, 'handleRequest', customizedFunction); |
| + var ext_id = extensionId; |
|
Matt Perry
2013/03/14 20:32:31
is this temporary needed?
felt
2013/03/15 00:04:47
Done.
|
| + var prefix = this.namespace; |
| + return this.setHook_(apiName, 'handleRequest', |
| + function() { |
| + logActivity(ext_id, prefix + "." + apiName, |
| + Array.prototype.slice.call(arguments)); |
| + return customizedFunction.apply(this, arguments); |
| + }); |
| }; |
| APIFunctions.prototype.setUpdateArgumentsPostValidate = |
| @@ -121,7 +130,7 @@ var platform = getPlatform(); |
| function Binding(schema) { |
| this.schema_ = schema; |
| - this.apiFunctions_ = new APIFunctions(); |
| + this.apiFunctions_ = new APIFunctions(schema.namespace); |
| this.customEvent_ = null; |
| this.customTypes_ = {}; |
| this.customHooks_ = []; |