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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 13726026: Added ActivityLog tests and associated bugfixes/extra logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted two changes 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
Index: chrome/browser/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index 0fbb8b021370f8b7fe92a3c4f9e395d193f85a32..432439621b3305b9bcf84ceac6f6673799cbdb85 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -59,6 +59,7 @@ namespace {
void AddAPIActionToExtensionActivityLog(
Profile* profile,
+ const std::string& call_type,
const extensions::Extension* extension,
const std::string& api_call,
scoped_ptr<ListValue> args,
@@ -70,6 +71,7 @@ void AddAPIActionToExtensionActivityLog(
FROM_HERE,
base::Bind(&AddAPIActionToExtensionActivityLog,
profile,
+ call_type,
extension,
api_call,
base::Passed(&args),
@@ -77,8 +79,12 @@ void AddAPIActionToExtensionActivityLog(
} else {
extensions::ActivityLog* activity_log =
extensions::ActivityLog::GetInstance(profile);
- if (activity_log && activity_log->IsLogEnabled())
- activity_log->LogAPIAction(extension, api_call, args.get(), extra);
+ if (activity_log && activity_log->IsLogEnabled()) {
+ if (call_type == "API")
palmer 2013/04/10 23:52:48 Hmm, how open-ended are these call types? Maybe an
+ activity_log->LogAPIAction(extension, api_call, args.get(), extra);
+ else if (call_type == "EVENT")
+ activity_log->LogEventAction(extension, api_call, args.get(), extra);
+ }
}
}
@@ -590,6 +596,7 @@ void ChromeRenderMessageFilter::OnExtensionResumeRequests(int route_id) {
}
void ChromeRenderMessageFilter::OnAddAPIActionToExtensionActivityLog(
+ const std::string& call_type,
const std::string& extension_id,
const ExtensionHostMsg_APIAction_Params& params) {
const extensions::Extension* extension =
@@ -597,7 +604,7 @@ void ChromeRenderMessageFilter::OnAddAPIActionToExtensionActivityLog(
scoped_ptr<ListValue> args(params.arguments.DeepCopy());
// The activity is recorded as an API action in the extension
// activity log.
- AddAPIActionToExtensionActivityLog(profile_, extension,
+ AddAPIActionToExtensionActivityLog(profile_, call_type, extension,
params.api_call, args.Pass(),
params.extra);
}

Powered by Google App Engine
This is Rietveld 408576698