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..519f019b07ee019fedb40a1e3e1e431936bfcf24 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 { |
+ kApiCall, |
+ kEvent |
Matt Perry
2013/04/12 01:03:17
Prevailing chrome style is to use ALL_CAPS for enu
felt
2013/04/12 02:07:21
The style guide says "New code should prefer const
Matt Perry
2013/04/12 17:04:43
Chrome has a list of addendums: http://dev.chromiu
felt
2013/04/12 20:37:23
Ah, thanks!
On 2013/04/12 17:04:43, Matt Perry wr
|
+ }; |
+ |
+ // 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); |
}; |