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

Unified Diff: trunk/src/chrome/browser/extensions/activity_log/counting_policy.cc

Issue 23600024: Revert 222242 "[Activity Log] when extension is uninstalled, del..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/extensions/activity_log/counting_policy.cc
===================================================================
--- trunk/src/chrome/browser/extensions/activity_log/counting_policy.cc (revision 222255)
+++ trunk/src/chrome/browser/extensions/activity_log/counting_policy.cc (working copy)
@@ -579,39 +579,6 @@
CleanStringTables(db);
}
-void CountingPolicy::DoRemoveExtensionData(const std::string& extension_id) {
- if (extension_id.empty())
- return;
-
- sql::Connection* db = GetDatabaseConnection();
- if (!db) {
- LOG(ERROR) << "Unable to connect to database";
- return;
- }
-
- // Make sure any queued in memory are sent to the database before cleaning.
- activity_database()->AdviseFlush(ActivityDatabase::kFlushImmediately);
-
- std::string sql_str = base::StringPrintf(
- "DELETE FROM %s WHERE extension_id_x=?", kTableName);
- sql::Statement statement(
- db->GetCachedStatement(sql::StatementID(SQL_FROM_HERE), sql_str.c_str()));
- int64 id;
- if (string_table_.StringToInt(db, extension_id, &id)) {
- statement.BindInt64(0, id);
- } else {
- // If the string isn't listed, that means we never recorded anything about
- // the extension so there's no deletion to do.
- return;
- }
- if (!statement.Run()) {
- LOG(ERROR) << "Removing URLs for extension "
- << extension_id << "from database failed: "
- << statement.GetSQLStatement();
- }
- CleanStringTables(db);
-}
-
void CountingPolicy::DoDeleteDatabase() {
sql::Connection* db = GetDatabaseConnection();
if (!db) {
@@ -684,10 +651,6 @@
ScheduleAndForget(this, &CountingPolicy::DoRemoveURLs, restrict_urls);
}
-void CountingPolicy::RemoveExtensionData(const std::string& extension_id) {
- ScheduleAndForget(this, &CountingPolicy::DoRemoveExtensionData, extension_id);
-}
-
void CountingPolicy::DeleteDatabase() {
ScheduleAndForget(this, &CountingPolicy::DoDeleteDatabase);
}

Powered by Google App Engine
This is Rietveld 408576698