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

Unified Diff: chrome/browser/webdata/autocomplete_syncable_service.cc

Issue 11272043: [Autofill] Enable client-side pruning of old autocomplete data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nada Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/autocomplete_syncable_service.cc
diff --git a/chrome/browser/webdata/autocomplete_syncable_service.cc b/chrome/browser/webdata/autocomplete_syncable_service.cc
index a28668af123d36d4377a051f33cd9fbbf45acc34..451ebfe99d3e0ccd7bfbea8724b56ee96b2d3c4f 100644
--- a/chrome/browser/webdata/autocomplete_syncable_service.cc
+++ b/chrome/browser/webdata/autocomplete_syncable_service.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/browser/webdata/web_database.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "net/base/escape.h"
@@ -81,9 +82,16 @@ bool MergeTimestamps(const sync_pb::AutofillSpecifics& autofill,
}
bool ShouldCullSyncedData() {
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+
// To set probability to 10% - set it to 0.1, 5% to 0.05, etc.
- static double kCullingProbability = 0.0;
- return (base::RandDouble() < kCullingProbability);
+ double culling_probability = 0.0;
+ if (channel == chrome::VersionInfo::CHANNEL_CANARY)
+ culling_probability = 1.0;
+ else if (channel == chrome::VersionInfo::CHANNEL_DEV)
+ culling_probability = 0.2;
+
+ return (base::RandDouble() < culling_probability);
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698