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

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

Issue 2980503002: [Extensions][TaskScheduler] Update ActivityLog for scheduling migration (Closed)
Patch Set: Experiments Created 3 years, 5 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_ACTIVITY_DATABASE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_DATABASE_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_DATABASE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // or changes to it. 165 // or changes to it.
166 void SoftFailureClose(); 166 void SoftFailureClose();
167 167
168 // Handle errors in database writes. For a serious & permanent error, it 168 // Handle errors in database writes. For a serious & permanent error, it
169 // invokes HardFailureClose(); for a less serious/permanent error, it invokes 169 // invokes HardFailureClose(); for a less serious/permanent error, it invokes
170 // SoftFailureClose(). 170 // SoftFailureClose().
171 void DatabaseErrorCallback(int error, sql::Statement* stmt); 171 void DatabaseErrorCallback(int error, sql::Statement* stmt);
172 172
173 // For unit testing only. 173 // For unit testing only.
174 void RecordBatchedActionsWhileTesting(); 174 void RecordBatchedActionsWhileTesting();
175 void SetTimerForTesting(int milliseconds);
176 175
177 // Retrieve a handle to the raw SQL database. This is only intended to be 176 // Retrieve a handle to the raw SQL database. This is only intended to be
178 // used by ActivityLogDatabasePolicy::GetDatabaseConnection(), and should 177 // used by ActivityLogDatabasePolicy::GetDatabaseConnection(), and should
179 // only be called on the database thread. 178 // only be called on the database thread.
180 sql::Connection* GetSqlConnection(); 179 sql::Connection* GetSqlConnection();
181 180
182 // A reference a Delegate for policy-specific database behavior. See the 181 // A reference a Delegate for policy-specific database behavior. See the
183 // top-level comment for ActivityDatabase for comments on cleanup. 182 // top-level comment for ActivityDatabase for comments on cleanup.
184 Delegate* delegate_; 183 Delegate* delegate_;
185 184
186 sql::Connection db_; 185 sql::Connection db_;
187 bool valid_db_; 186 bool valid_db_;
188 bool batch_mode_; 187 bool batch_mode_;
189 base::TimeDelta batching_period_; 188 base::TimeDelta batching_period_;
190 base::RepeatingTimer timer_; 189 base::RepeatingTimer timer_;
191 bool already_closed_; 190 bool already_closed_;
192 bool did_init_; 191 bool did_init_;
193 192
194 friend class ActivityLogDatabasePolicy; 193 friend class ActivityLogDatabasePolicy;
195 FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeOff); 194 friend class ActivityDatabaseTest;
196 FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeOn);
197 FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeFlush);
198 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase); 195 DISALLOW_COPY_AND_ASSIGN(ActivityDatabase);
199 }; 196 };
200 197
201 } // namespace extensions 198 } // namespace extensions
202 199
203 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_DATABASE_H_ 200 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698