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

Side by Side Diff: chrome/browser/extensions/activity_log/counting_policy.h

Issue 154053004: Introducing the activityLogPrivate.deleteActivities() API call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 27 matching lines...) Expand all
38 <void(scoped_ptr<Action::ActionVector>)>& callback) OVERRIDE; 38 <void(scoped_ptr<Action::ActionVector>)>& callback) OVERRIDE;
39 39
40 virtual void Close() OVERRIDE; 40 virtual void Close() OVERRIDE;
41 41
42 // Gets or sets the amount of time that old records are kept in the database. 42 // Gets or sets the amount of time that old records are kept in the database.
43 const base::TimeDelta& retention_time() const { return retention_time_; } 43 const base::TimeDelta& retention_time() const { return retention_time_; }
44 void set_retention_time(const base::TimeDelta& delta) { 44 void set_retention_time(const base::TimeDelta& delta) {
45 retention_time_ = delta; 45 retention_time_ = delta;
46 } 46 }
47 47
48 // Remove actions (rows) which IDs are specified in the action_ids array.
49 virtual void RemoveActions(const std::vector<int64>& action_ids) OVERRIDE;
50
48 // Clean the URL data stored for this policy. 51 // Clean the URL data stored for this policy.
49 virtual void RemoveURLs(const std::vector<GURL>&) OVERRIDE; 52 virtual void RemoveURLs(const std::vector<GURL>&) OVERRIDE;
50 53
51 // Clean the data related to this extension for this policy. 54 // Clean the data related to this extension for this policy.
52 virtual void RemoveExtensionData(const std::string& extension_id) OVERRIDE; 55 virtual void RemoveExtensionData(const std::string& extension_id) OVERRIDE;
53 56
54 // Delete everything in the database. 57 // Delete everything in the database.
55 virtual void DeleteDatabase() OVERRIDE; 58 virtual void DeleteDatabase() OVERRIDE;
56 59
57 // The main database table, and the name for a read-only view that 60 // The main database table, and the name for a read-only view that
(...skipping 26 matching lines...) Expand all
84 // Internal method to read data from the database; called on the database 87 // Internal method to read data from the database; called on the database
85 // thread. 88 // thread.
86 scoped_ptr<Action::ActionVector> DoReadFilteredData( 89 scoped_ptr<Action::ActionVector> DoReadFilteredData(
87 const std::string& extension_id, 90 const std::string& extension_id,
88 const Action::ActionType type, 91 const Action::ActionType type,
89 const std::string& api_name, 92 const std::string& api_name,
90 const std::string& page_url, 93 const std::string& page_url,
91 const std::string& arg_url, 94 const std::string& arg_url,
92 const int days_ago); 95 const int days_ago);
93 96
97 // The implementation of RemoveActions; this must only run on the database
98 // thread.
99 void DoRemoveActions(const std::vector<int64>& action_ids);
100
94 // The implementation of RemoveURLs; this must only run on the database 101 // The implementation of RemoveURLs; this must only run on the database
95 // thread. 102 // thread.
96 void DoRemoveURLs(const std::vector<GURL>& restrict_urls); 103 void DoRemoveURLs(const std::vector<GURL>& restrict_urls);
97 104
98 // The implementation of RemoveExtensionData; this must only run on the 105 // The implementation of RemoveExtensionData; this must only run on the
99 // database thread. 106 // database thread.
100 void DoRemoveExtensionData(const std::string& extension_id); 107 void DoRemoveExtensionData(const std::string& extension_id);
101 108
102 // The implementation of DeleteDatabase; called on the database thread. 109 // The implementation of DeleteDatabase; called on the database thread.
103 void DoDeleteDatabase(); 110 void DoDeleteDatabase();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 148
142 friend class CountingPolicyTest; 149 friend class CountingPolicyTest;
143 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, EarlyFlush); 150 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, EarlyFlush);
144 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, MergingAndExpiring); 151 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, MergingAndExpiring);
145 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, StringTableCleaning); 152 FRIEND_TEST_ALL_PREFIXES(CountingPolicyTest, StringTableCleaning);
146 }; 153 };
147 154
148 } // namespace extensions 155 } // namespace extensions
149 156
150 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_ 157 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_COUNTING_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698