Index: chrome/browser/local_discovery/privet_notifications.cc |
diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc |
index 3faceaff25b9582c6aa6a29c21a5c17728a59473..b378a64097150e0c253268c11f8694430af14bc0 100644 |
--- a/chrome/browser/local_discovery/privet_notifications.cc |
+++ b/chrome/browser/local_discovery/privet_notifications.cc |
@@ -6,6 +6,7 @@ |
#include "base/bind.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/rand_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/local_discovery/privet_device_lister_impl.h" |
#include "chrome/browser/notifications/notification.h" |
@@ -32,6 +33,7 @@ const int kTenMinutesInSeconds = 600; |
const char kPrivetInfoKeyUptime[] = "uptime"; |
const char kPrivetNotificationIDPrefix[] = "privet_notification:"; |
const char kPrivetNotificationOriginUrl[] = "chrome://devices"; |
+const int kStartDelaySeconds = 30; |
} |
PrivetNotificationsListener::PrivetNotificationsListener( |
@@ -150,9 +152,11 @@ PrivetNotificationService::PrivetNotificationService( |
NotificationUIManager* notification_manager) |
: profile_(profile), |
notification_manager_(notification_manager) { |
- base::MessageLoop::current()->PostTask( |
+ base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
- base::Bind(&PrivetNotificationService::Start, AsWeakPtr())); |
+ base::Bind(&PrivetNotificationService::Start, AsWeakPtr()), |
+ base::TimeDelta::FromSeconds(kStartDelaySeconds + |
+ base::RandInt(0, kStartDelaySeconds/4))); |
} |
PrivetNotificationService::~PrivetNotificationService() { |