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

Unified Diff: chrome/browser/extensions/activity_log.cc

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
Index: chrome/browser/extensions/activity_log.cc
diff --git a/chrome/browser/extensions/activity_log.cc b/chrome/browser/extensions/activity_log.cc
index dcf8e8fdd5a54c209d08ffb0492afe6d4533c2bc..f757062acaad7b5f48107b3b8b85ba7b41b0c843 100644
--- a/chrome/browser/extensions/activity_log.cc
+++ b/chrome/browser/extensions/activity_log.cc
@@ -143,17 +143,16 @@ bool ActivityLogFactory::ServiceRedirectedInIncognito() const {
// Use GetInstance instead of directly creating an ActivityLog.
ActivityLog::ActivityLog(Profile* profile) {
// enable-extension-activity-logging and enable-extension-activity-ui
- log_activity_to_stdout_ = CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kEnableExtensionActivityLogging);
- log_activity_to_ui_ = CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kEnableExtensionActivityUI);
+ log_activity_to_stdout_ = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionActivityLogging);
+ log_activity_to_ui_ = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionActivityUI);
// enable-extension-activity-log-testing
- // Currently, this just controls whether arguments are collected. In the
- // future, it may also control other optional activity log features.
- log_arguments_ = CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kEnableExtensionActivityLogTesting);
- if (!log_arguments_) {
+ // This controls whether arguments are collected.
+ testing_mode_ = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionActivityLogTesting);
+ if (!testing_mode_) {
for (int i = 0; i < APIAction::kSizeAlwaysLog; i++) {
arg_whitelist_api_.insert(std::string(APIAction::kAlwaysLog[i]));
}
@@ -244,7 +243,7 @@ void ActivityLog::LogAPIAction(const Extension* extension,
ListValue* args,
const std::string& extra) {
if (!IsLogEnabled()) return;
- if (!log_arguments_ &&
+ if (!testing_mode_ &&
arg_whitelist_api_.find(api_call) == arg_whitelist_api_.end())
args->Clear();
LogAPIActionInternal(extension,
@@ -263,7 +262,7 @@ void ActivityLog::LogEventAction(const Extension* extension,
ListValue* args,
const std::string& extra) {
if (!IsLogEnabled()) return;
- if (!log_arguments_ &&
+ if (!testing_mode_ &&
arg_whitelist_api_.find(api_call) == arg_whitelist_api_.end())
args->Clear();
LogAPIActionInternal(extension,
@@ -279,7 +278,7 @@ void ActivityLog::LogBlockedAction(const Extension* extension,
const char* reason,
const std::string& extra) {
if (!IsLogEnabled()) return;
- if (!log_arguments_ &&
+ if (!testing_mode_ &&
arg_whitelist_api_.find(blocked_call) == arg_whitelist_api_.end())
args->Clear();
scoped_refptr<BlockedAction> action = new BlockedAction(extension->id(),

Powered by Google App Engine
This is Rietveld 408576698