Chromium Code Reviews| Index: chrome/renderer/extensions/api_activity_logger.h |
| diff --git a/chrome/renderer/extensions/api_activity_logger.h b/chrome/renderer/extensions/api_activity_logger.h |
| index a2a0fd37fae9383a84b75e3dfd3be27e6d3ad8c3..6f96f168c8115683c11b6fc35673414301fdb66e 100644 |
| --- a/chrome/renderer/extensions/api_activity_logger.h |
| +++ b/chrome/renderer/extensions/api_activity_logger.h |
| @@ -12,22 +12,40 @@ |
| namespace extensions { |
| -// Used to log extension API calls that are implemented with custom bindings. |
| -// The events are sent via IPC to extensions::ActivityLog for recording and |
| -// display. |
| +// Used to log extension API calls and events that are implemented with custom |
| +// bindings.The actions are sent via IPC to extensions::ActivityLog for |
| +// recording and display. |
| class APIActivityLogger : public ChromeV8Extension { |
| public: |
| APIActivityLogger(Dispatcher* dispatcher, v8::Handle<v8::Context> v8_context); |
| // This is ultimately invoked in schema_generated_bindings.js with |
| - // JavaScript arguments... |
| + // JavaScript arguments. Logged as an APIAction. |
| // arg0 - extension ID as a string |
| // arg1 - API call name as a string |
| // arg2 - arguments to the API call |
| // arg3 - any extra logging info as a string (optional) |
| - static v8::Handle<v8::Value> LogActivity(const v8::Arguments & args); |
| + static v8::Handle<v8::Value> LogAPICall(const v8::Arguments& args); |
| + |
| + // This is ultimately invoked in schema_generated_bindings.js with |
| + // JavaScript arguments. Logged as an EventAction. |
| + // arg0 - extension ID as a string |
| + // arg1 - Event name as a string |
| + // arg2 - Event arguments |
| + // arg3 - any extra logging info as a string (optional) |
| + static v8::Handle<v8::Value> LogEvent(const v8::Arguments& args); |
| private: |
| + enum CallType { |
| + APICALL, |
|
Matt Perry
2013/04/12 20:50:34
nit: API_CALL
felt
2013/04/12 20:51:46
I get a compiler error if I do API_CALL. I'm not s
Matt Perry
2013/04/12 20:53:52
Oh weird. Nah, this is fine.
On 2013/04/12 20:51:
|
| + EVENT |
| + }; |
| + |
| + // LogAPICall and LogEvent are really the same underneath except for |
| + // how they are ultimately dispatched to the log. |
| + static void LogInternal(const CallType call_type, |
| + const v8::Arguments& args); |
| + |
| DISALLOW_COPY_AND_ASSIGN(APIActivityLogger); |
| }; |