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

Unified Diff: chrome/browser/rlz/rlz.cc

Issue 149135: Add a ping delay time master preference. (Closed)
Patch Set: Created 11 years, 6 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 | « chrome/browser/rlz/rlz.h ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/rlz/rlz.cc
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 96ea0c249e7aa71881419d06de1529d090a2ef30..a280be2d9f846aa4812221eab25b29f223c571d0 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -287,13 +287,22 @@ bool RLZTracker::InitRlz(int directory_key) {
return LoadRLZLibrary(directory_key);
}
-bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) {
+bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run, int delay) {
+ // Maximum and minimum delay we would allow to be set through master
+ // preferences. Somewhat arbitrary, may need to be adjusted in future.
+ const int kMaxDelay = 200 * 1000;
+ const int kMinDelay = 20 * 1000;
+
+ delay *= 1000;
+ delay = (delay < kMinDelay) ? kMinDelay : delay;
+ delay = (delay > kMaxDelay) ? kMaxDelay : delay;
+
if (!OmniBoxUsageObserver::used())
new OmniBoxUsageObserver();
+
// Schedule the delayed init items.
- const int kNinetySeconds = 90 * 1000;
MessageLoop::current()->PostDelayedTask(FROM_HERE,
- new DelayedInitTask(directory_key, first_run), kNinetySeconds);
+ new DelayedInitTask(directory_key, first_run), delay);
return true;
}
« no previous file with comments | « chrome/browser/rlz/rlz.h ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698