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

Side by Side Diff: chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc

Issue 15573003: New architecture of the activity logging: Policies for summarization (and compression) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Adrienne's final comments. Created 7 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright $YEAR The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/json/json_string_value_serializer.h"
6 #include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h"
7
8 namespace extensions {
9
10 StreamWithoutArgsUIPolicy::StreamWithoutArgsUIPolicy(
11 Profile* profile,
12 content::BrowserThread::ID thread_id)
13 : FullStreamUIPolicy(profile, thread_id) {
14 for (int i = 0; i < APIAction::kSizeAlwaysLog; i++) {
15 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.
16 }
17 }
18
19 StreamWithoutArgsUIPolicy::~StreamWithoutArgsUIPolicy() {}
20
21 void StreamWithoutArgsUIPolicy::ProcessArguments(
22 ActionType action_type,
23 const std::string& name,
24 const base::ListValue* args,
25 std::stringstream& args_string) const {
26
Matt Perry 2013/05/30 18:55:32 nit: rm newline
dbabic 2013/05/30 21:51:25 Done.
27 if (action_type == ACTION_DOM ||
28 arg_whitelist_api_.find(name) != arg_whitelist_api_.end()) {
29 FullStreamUIPolicy::ProcessArguments(action_type, name, args, args_string);
30 } else {
31 return;
32 }
33 }
34
35 void StreamWithoutArgsUIPolicy::ProcessWebRequestModifications(
36 base::DictionaryValue& details,
37 std::string& details_string) const {
38 // Strip details of the web request modifications (for privacy reasons).
39 DictionaryValue::Iterator details_iterator(details);
40 while (!details_iterator.IsAtEnd()) {
41 details.SetBoolean(details_iterator.key(), true);
42 details_iterator.Advance();
43 }
44 JSONStringValueSerializer serializer(&details_string);
45 serializer.SerializeAndOmitBinaryValues(details);
46 }
47
48 } // End of namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698