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

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

Issue 23432006: [Activity log] Strip incognito URLs entirely from the database (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/activity_log/activity_log_policy.h" 5 #include "chrome/browser/extensions/activity_log/activity_log_policy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return value_as_text; 79 return value_as_text;
80 } 80 }
81 81
82 // static 82 // static
83 void ActivityLogPolicy::Util::StripPrivacySensitiveFields( 83 void ActivityLogPolicy::Util::StripPrivacySensitiveFields(
84 scoped_refptr<Action> action) { 84 scoped_refptr<Action> action) {
85 // Clear incognito URLs/titles. 85 // Clear incognito URLs/titles.
86 if (action->page_incognito()) { 86 if (action->page_incognito()) {
87 action->set_page_url(GURL()); 87 action->set_page_url(GURL());
88 action->set_page_title(""); 88 action->set_page_title("");
89 action->set_page_incognito(false);
89 } 90 }
90 if (action->arg_incognito()) { 91 if (action->arg_incognito()) {
91 action->set_arg_url(GURL()); 92 action->set_arg_url(GURL());
93 action->set_arg_incognito(false);
92 } 94 }
93 95
94 // Strip query parameters, username/password, etc., from URLs. 96 // Strip query parameters, username/password, etc., from URLs.
95 if (action->page_url().is_valid() || action->arg_url().is_valid()) { 97 if (action->page_url().is_valid() || action->arg_url().is_valid()) {
96 url_canon::Replacements<char> url_sanitizer; 98 url_canon::Replacements<char> url_sanitizer;
97 url_sanitizer.ClearUsername(); 99 url_sanitizer.ClearUsername();
98 url_sanitizer.ClearPassword(); 100 url_sanitizer.ClearPassword();
99 url_sanitizer.ClearQuery(); 101 url_sanitizer.ClearQuery();
100 url_sanitizer.ClearRef(); 102 url_sanitizer.ClearRef();
101 103
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 base::StringPrintf("DROP TABLE %s", table_name); 170 base::StringPrintf("DROP TABLE %s", table_name);
169 if (!db->Execute(drop_statement.c_str())) { 171 if (!db->Execute(drop_statement.c_str())) {
170 return false; 172 return false;
171 } 173 }
172 } 174 }
173 } 175 }
174 return true; 176 return true;
175 } 177 }
176 178
177 } // namespace extensions 179 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698