Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3775)

Unified Diff: chrome/renderer/extensions/api_activity_logger.h

Issue 13726026: Added ActivityLog tests and associated bugfixes/extra logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrapped line Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/api_activity_logger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/api_activity_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698