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

Unified Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 7972022: Minor debugging fix so we fetch promos every 3 min when we're testing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 9 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
« 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/web_resource/promo_resource_service.cc
===================================================================
--- chrome/browser/web_resource/promo_resource_service.cc (revision 102401)
+++ chrome/browser/web_resource/promo_resource_service.cc (working copy)
@@ -28,8 +28,9 @@
// Delay on first fetch so we don't interfere with startup.
static const int kStartResourceFetchDelay = 5000;
-// Delay between calls to update the cache (48 hours).
+// Delay between calls to update the cache (48 hours), and 3 min in debug mode.
static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000;
+static const int kDebugCacheUpdateDelay = 3 * 60 * 1000;
// Users are randomly assigned to one of kNTPPromoGroupSize buckets, in order
// to be able to roll out promos slowly, or display different promos to
@@ -80,6 +81,11 @@
promo_server_url.c_str();
}
+int GetCacheUpdateDelay() {
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kPromoServerURL) ? kDebugCacheUpdateDelay : kCacheUpdateDelay;
+}
+
} // namespace
// Server for dynamically loaded NTP HTML elements.
@@ -155,7 +161,7 @@
chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED,
prefs::kNTPPromoResourceCacheUpdate,
kStartResourceFetchDelay,
- kCacheUpdateDelay),
+ GetCacheUpdateDelay()),
profile_(profile),
channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) {
Init();
« 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