 Chromium Code Reviews
 Chromium Code Reviews Issue 15573003:
  New architecture of the activity logging: Policies for summarization (and compression)  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 15573003:
  New architecture of the activity logging: Policies for summarization (and compression)  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc | 
| diff --git a/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..e6944eea4a7e1ff5037389dd6287776888959e0d | 
| --- /dev/null | 
| +++ b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc | 
| @@ -0,0 +1,48 @@ | 
| +// Copyright $YEAR The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#include "base/json/json_string_value_serializer.h" | 
| +#include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h" | 
| + | 
| +namespace extensions { | 
| + | 
| +StreamWithoutArgsUIPolicy::StreamWithoutArgsUIPolicy( | 
| + Profile* profile, | 
| + content::BrowserThread::ID thread_id) | 
| + : FullStreamUIPolicy(profile, thread_id) { | 
| + for (int i = 0; i < APIAction::kSizeAlwaysLog; i++) { | 
| + arg_whitelist_api_.insert(std::string(APIAction::kAlwaysLog[i])); | 
| 
Matt Perry
2013/05/30 18:55:32
the explicit call to std::string should be unneces
 
dbabic
2013/05/30 21:51:25
Done.
 | 
| + } | 
| +} | 
| + | 
| +StreamWithoutArgsUIPolicy::~StreamWithoutArgsUIPolicy() {} | 
| + | 
| +void StreamWithoutArgsUIPolicy::ProcessArguments( | 
| + ActionType action_type, | 
| + const std::string& name, | 
| + const base::ListValue* args, | 
| + std::stringstream& args_string) const { | 
| + | 
| 
Matt Perry
2013/05/30 18:55:32
nit: rm newline
 
dbabic
2013/05/30 21:51:25
Done.
 | 
| + if (action_type == ACTION_DOM || | 
| + arg_whitelist_api_.find(name) != arg_whitelist_api_.end()) { | 
| + FullStreamUIPolicy::ProcessArguments(action_type, name, args, args_string); | 
| + } else { | 
| + return; | 
| + } | 
| +} | 
| + | 
| +void StreamWithoutArgsUIPolicy::ProcessWebRequestModifications( | 
| + base::DictionaryValue& details, | 
| + std::string& details_string) const { | 
| + // Strip details of the web request modifications (for privacy reasons). | 
| + DictionaryValue::Iterator details_iterator(details); | 
| + while (!details_iterator.IsAtEnd()) { | 
| + details.SetBoolean(details_iterator.key(), true); | 
| + details_iterator.Advance(); | 
| + } | 
| + JSONStringValueSerializer serializer(&details_string); | 
| + serializer.SerializeAndOmitBinaryValues(details); | 
| +} | 
| + | 
| +} // End of namespace extensions |