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

Side by Side Diff: components/gcm_driver/gcm_backoff_policy.cc

Issue 530253002: Add GCMChannelStatusRequest to talk with server for all users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn build Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/gcm_driver/gcm_backoff_policy.h"
6
7 namespace gcm {
8
9 namespace {
10
11 // Backoff policy. Shared across GCM requests.
12 // Note: In order to ensure a minimum of 20 seconds between server errors (for
13 // server reasons), we have a 30s +- 10s (33%) jitter initial backoff.
14 const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
15 // Number of initial errors (in sequence) to ignore before applying
16 // exponential back-off rules.
17 0,
18
19 // Initial delay for exponential back-off in ms.
20 30 * 1000, // 30 seconds.
21
22 // Factor by which the waiting time will be multiplied.
23 2,
24
25 // Fuzzing percentage. ex: 10% will spread requests randomly
26 // between 90%-100% of the calculated time.
27 0.33, // 33%.
28
29 // Maximum amount of time we are willing to delay our request in ms.
30 10 * 60 * 1000, // 10 minutes.
31
32 // Time to keep an entry from being discarded even when it
33 // has no significant state, -1 to never discard.
34 -1,
35
36 // Don't use initial delay unless the last request was an error.
37 false,
38 };
39
40 } // namespace
41
42 const net::BackoffEntry::Policy& GetGCMBackoffPolicy() {
43 return kDefaultBackoffPolicy;
44 }
45
46 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_backoff_policy.h ('k') | components/gcm_driver/gcm_channel_status_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698